首页 > 解决方案 > EditText 的提示不适用于 Android 4.0.4 中的阿拉伯语

问题描述

当我在 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" />

字符串.xml

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

我已经在这个问题中阅读了这些答案,但没有任何帮助:(

请帮我...

标签: androidandroid-edittextarabichint

解决方案


在此处输入图像描述

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

在清单中添加这一行

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

推荐阅读