我使用 Hint
并且它在模拟器中工作,但是当我在手机中安装代码时,Hint 不起作用。
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="نام"
android:gravity="right"
android:id="@+id/fname"
android:singleLine="true"
android:imeActionLabel="Next">
</EditText>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="نام خانوادگی"
android:gravity="right"
android:id="@+id/lname"
android:singleLine="true"
android:imeActionLabel="Next">
</EditText>
有什么想法吗?
最佳答案
复制strings.xml中的String
(指你的相关语言)然后给出提示
android:hint="@string/strname"
<resources>
<string name="strname">نام خانوادگی</string>
</resources>
如果设备支持您的语言,以上内容将有效。
android:singleLine="true"
从你的编辑文本中删除它然后你就可以看到提示
关于android - 提示在 android 的 edittext 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14053860/