小编pey*_*man的帖子

RTL android:TextInputLayout 中的提示

我有这样的 XML 布局:

 <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.ConstraintLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layoutDirection="locale" 
        android:textDirection="rtl"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".app.storey.view.StoreyInsertFragment">

    <com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="somthing"
            app:layout_constraintEnd_toEndOf="parent"
            android:layout_marginEnd="8dp"
            android:layout_marginTop="8dp"
            app:layout_constraintStart_toStartOf="parent"
            android:layout_marginStart="8dp"
            app:layout_constraintHorizontal_bias="0.0" 
            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>

</androidx.constraintlayout.widget.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

我希望hint文字显示在右侧,但使用后layoutDirectiontextAlignment仍然显示在左侧,我该怎么做?

我看到这个链接但没有解决我的问题。

android right-to-left textinputlayout

8
推荐指数
1
解决办法
3356
查看次数

标签 统计

android ×1

right-to-left ×1

textinputlayout ×1