【发布时间】:2019-06-02 20:45:27
【问题描述】:
Material TextInputLayout 样式不起作用。
我在这里关注了关于材料 textinputlayout 的文档: https://material.io/develop/android/components/text-input-layout/
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:hint="@string/app_name"
app:boxStrokeColor="@android:color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
使用 gradle:
implementation 'com.google.android.material:material:1.1.0-alpha02'
使用样式 OutlinedBox,我希望布局有一个轮廓,但它只显示一个纯 TextInputLayout。
【问题讨论】:
-
试试
implementation 'com.google.android.material:material:1.0.0' -
还是不行
-
@GabLedesma 已经在设备或 XML 中运行您的代码
-
@NileshRathod 当我运行它时它正在工作。但在预览中它不是。诡异的。无论如何,谢谢!
标签: android android-layout material-design