Я использую android привязку данных и android studio. У меня файл ниже xml.
У меня проблема.
Элемент androidx.coordinatorlayout.widget.CoordinatorLayout
здесь не разрешен
Я попытался изменить CordinatorLayout с MaterialCardView, и он снова показывает
Элемент com.google.android.material.card.MaterialCardView
здесь не разрешен
Я не могу понять, в чем здесь проблема. Но когда я строю проект, он строится успешно. Но android студия не показывает автозаполнение. У кого-нибудь есть идеи, пожалуйста.
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#AF5C5C"
android:padding="25dp"
tools:context=".LoginActivity">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:id="@+id/wrapper_card"
app:cardCornerRadius="15dp"
style="@style/Widget.MaterialComponents.CardView"
android:elevation="10dp"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:id="@+id/view"
android:padding="10dp"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatButton
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/button_show_signup"
android:id="@+id/button_show_signin"
android:text="Signin"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<androidx.appcompat.widget.AppCompatButton
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/button_show_signin"
app:layout_constraintRight_toRightOf="parent"
android:id="@+id/button_show_signup"
android:text="SignUP"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.google.android.material.textfield.TextInputLayout
app:layout_constraintTop_toBottomOf="@id/button_show_signin"
android:hint="@string/user_name"
android:id="@+id/user_name_container"
style="@style/AppTextInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
style="@style/AppTextInputEditText"
android:id="@+id/user_edit_text"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
app:layout_constraintTop_toBottomOf="@id/user_name_container"
android:hint="@string/mobile"
android:id="@+id/mobile_number_container"
style="@style/AppTextInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:id="@+id/mobile_number"
android:inputType="textPassword"
style="@style/AppTextInputEditText"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
app:layout_constraintTop_toBottomOf="@id/mobile_number_container"
android:hint="@string/address"
android:id="@+id/password_container"
style="@style/AppTextInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:id="@+id/password_edit_text"
android:inputType="textPassword"
style="@style/AppTextInputEditText"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="70dp"
android:background="@drawable/circular_image"
app:srcCompat="@drawable/ic_arrow_forward_black_24dp"
android:padding="15dp"
android:id="@+id/login_button"
app:layout_anchor="@id/view"
android:tint="#FFFFFF"
app:layout_anchorGravity="bottom|center"
android:elevation="10dp"
android:layout_height="70dp"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>