android - 对于阿拉伯语,EditText 提示中的光标不是从右开始

标签 android android-edittext arabic right-to-left hint

我正在尝试使用提示文本制作 EditText: 在英语中“密码”.. 光标正确设置在左侧。 但对于提示为“كلمه المرور”的阿拉伯语,光标始终设置在左侧(提示的末尾)而不是右侧。

<EditText
        android:id="@id/ETPass"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/etUsrName"
        android:layout_marginLeft="@dimen/_25sdp"
        android:layout_marginRight="@dimen/_25sdp"
        android:layout_marginTop="@dimen/_5sdp"
        android:background="@drawable/signup_edittext_input"
        android:ellipsize="start"
        android:gravity="center|right"
        android:hint="@string/Password"
        android:imeOptions="actionNext"
        android:inputType="textPassword"
        android:paddingRight="@dimen/_5sdp"
        android:singleLine="true"
        android:textColor="@color/orange"
        android:textColorHint="@color/orange" />

这只发生在 android:inputType="textPassword" 中。对于普通文本 inputType 一切正常。

最佳答案

对于 Android 17 及更高版本(4.2.+),它的工作原理:

android:textAlignment="viewStart"

关于android - 对于阿拉伯语,EditText 提示中的光标不是从右开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30456236/

相关文章:

RTL 语言的 Android 本地化

android - 从 pt 中的 CSS 字体大小转换为 Android 等价物

android - 没有在日志中获取动态链接

android - 带有不可选择的灰色前缀的 EditText

android - 自定义 EditText 默认光标位置

ios - 阿拉伯字符的AES加密-Objective C

安卓。使 webview 大小适合 youtube 视频大小

android - 使用 MotionLayout 时如何在 ImageView 上将色调指定为自定义属性

Android:EditText焦点跳转到ScrollView里面的另一个

php - str_replace 不适用于某些字符