我正在处理登录界面,希望使用material edit text实现以下视图:
以下是我的代码:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
style="@style/ThemeOverlay.MaterialComponents.TextInputEditText.OutlinedBox"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="This is Hint"/>
</com.google.android.material.textfield.TextInputLayout>
但是OutlinedBox没有出现。它的样子是这样的: 请帮忙。
TextInputLayout
的主题,而不是TextInputEditText
的主题。您正在使用错误的样式,请使用此样式:style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
。 - Jeel Vankhede