在Android 4.0.4中,EditText的提示不适用于阿拉伯语言

问题描述 投票:0回答:2

当我在Android设备中启动我的应用程序(4.0.4) 我没有在EditText看到阿拉伯语暗示

activity_main.xml中

<EditText
    android:id="@+id/gradeInput"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="1dp"
    android:layout_marginLeft="1dp"
    android:layout_marginTop="208dp"
    android:layout_marginEnd="1dp"
    android:layout_marginRight="1dp"
    android:layout_marginBottom="478dp"
    android:autofillHints=""
    android:ems="10"
    android:hint="@string/inputHint"
    android:inputType="numberDecimal"
    android:maxLength="5"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:targetApi="o" />

strings.xml中

<string name="inputHint">تلميح</string>

我在这个question读过这些答案,但没有任何帮助我:(

请帮我...

android android-edittext arabic hint
2个回答
0
投票

enter image description here

我不知道你的代码但是。您必须在android中创建一个阿拉伯语字符串文件,您可以使用阿拉伯语中的提示,并且有一个默认的英语字符串。因此,在运行您的应用程序时,请将手机语言更改为阿并且您的字符串将自动工作

在清单中添加此行

   <application
        ...
        android:supportsRtl="true"
        ... >
    </application>

0
投票

我找到了解决方案!

要解决这个问题,你需要删除inputType属性,它会正常工作。

或者你可以这样做:

<EditText
    ...
    android:inputType="none" />

但是你不能改变inputType属性。

因为如果您更改了它,如果提示是阿拉伯语,则提示将为空

© www.soinside.com 2019 - 2024. All rights reserved.