如何在Android材质的文本输入布局中镜像框笔划?

时间:2019-07-19 13:36:47

标签: java android xml material-design

我想用Google材料创建一个文本字段,而我的文本字段是rtl。

如何镜像框笔划?

mirror box

1 个答案:

答案 0 :(得分:0)

在应用程序渐变中添加以下材料库

implementation 'com.google.android.material:material:1.0.0'

使用TextInputLayout如下

<com.google.android.material.textfield.TextInputLayout
                android:id="@+id/input_layout_title"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="16dp"
                android:hint="Hint Text"
                app:layout_constraintTop_toTopOf="parent">

                <AutoCompleteTextView
                    android:id="@+id/edtxt_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:imeOptions="actionNext"
                    android:inputType="text"
                    android:maxLines="1" />
            </com.google.android.material.textfield.TextInputLayout>

有关更多详细信息,请访问

https://material.io/develop/android/components/text-input-layout/