我看到有很多關于這個話題的話題,但似乎沒有一個能解決我的問題。
我在 InputLayout 中有一個 EditText,它顯示為空白,直到獲得焦點。
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_marginTop="20dp"
>
<com.google.android.material.textfield.TextInputEditText
android:id="@ id/etInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:hint="Name"/>
安卓版本 12
uj5u.com熱心網友回復:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black"
android:layout_marginTop="20dp"
app:boxStrokeWidth="2dp"
android:textColorHint="@color/black"
>
<EditText
android:id="@ id/etInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/black"
/>
</com.google.android.material.textfield.TextInputLayout>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/467246.html
