java应用程序:boxStrokeWidthFocused=“2dp”在API≤28的较低设备上不起作用
在AndroidX中,我对文本字段使用了材料设计。在textinputlayyt中,属性app:boxStrokeWidthFocused="2dp"
对于API 30和29非常有效,但是当我在较低的API上测试它时,它不起作用,在我点击框之前,它显示了笔划2dp。我怎样才能解决它?请帮帮我。提前谢谢
我的XML代码:
<com.google.安卓.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
安卓:layout_width="match_parent"
安卓:layout_height="wrap_content"
安卓:hint="User Name"
app:hintTextColor="@color/black"
安卓:textColorHint="@color/black"
安卓:focusableInTouchMode="true"
app:boxStrokeWidth="1dp"
app:boxStrokeWidthFocused="2dp"
app:boxStrokeColor="@color/red">
<com.google.安卓.material.textfield.TextInputEditText
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
安卓:inputType="text"
安卓:textColor="@color/black"/>
</com.google.安卓.material.textfield.TextInputLayout>
共 (0) 个答案