在android textview中显示阿拉伯文本 [英] Display Arabic text in android textview
本文介绍了在android textview中显示阿拉伯文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想开发Android应用程序在那里我有<代码> HTML 的保存在文件夹资产的文件,这些文件包含阿拉伯文字是这样的قلاللهممالكالملكتؤتيالملكمنتشاءوتنزعالملكممنتشاء
我想设置 textView
这个文本我试过波斯语课,但它没有正确显示.有任何想法吗?
I'm trying to develop android app where I have html
files saved in asset folders, these files contain Arabic text like this قُلِ اللَّهُمَّ مَالِكَ الْمُلْكِ تُؤْتِي الْمُلْكَ مَنْ تَشَاءُ وَتَنْزِعُ الْمُلْكَ مِمَّنْ تَشَاءُ
I want to set textView
whit this text I tried Farsi class but it doesn't show it properly.
Any ideas?
推荐答案
使用 android:textDirection 带有anyRtl".
从 xml:添加此行:
android:textDirection="anyRtl"
到您的TextView
标记.
来自代码:textview.setTextDirection(View.TEXT_DIRECTION_ANY_RTL);
PS:从 API 17+ 开始.
PS: Since API 17+.
这篇关于在android textview中显示阿拉伯文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文