Android游标以RTL语言显示

Ami*_*r H 8 layout android cursor right-to-left

我在RTL语言中有android输入游标的问题.当我在RTL支持布局时,我有两个输入光标,这真的很有趣.是否有真正的解决方案,摆脱这个?

我使用此代码来制作我的Android UI RTL:

getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
Run Code Online (Sandbox Code Playgroud)

这是我的文本视图xml:

<android.support.design.widget.TextInputLayout
        android:id="@+id/input_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="numberDecimal"
            android:id="@+id/myID"
            android:maxLines="1"
            android:focusableInTouchMode="true"
            android:layout_weight="0.25"
            android:layout_gravity="center_horizontal"
            android:hint="phone Number"
            android:maxLength="20"
            android:gravity="center" />
    </android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Ami*_*r H 1

我解决问题。只需将编辑文本语言从左到右设置即可解决问题。

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="number"
    android:ems="10"
    android:id="@+id/PhoneNoET"
    android:layout_marginTop="64dp"
    android:layout_below="@+id/textView6"
    android:layout_centerHorizontal="true"
    android:textAlignment="center"
    android:maxLength="11" 
    android:layoutDirection="ltr"/>
Run Code Online (Sandbox Code Playgroud)

将上面的布局方向添加到您的编辑文本并解决问题。