android - 阿拉伯文本显示问题

标签 android

我在 android 设备上显示阿拉伯语文本时遇到问题

需求文本如下所示

enter image description here

我得到的是这样的不同文本

enter image description here

我正在为此使用以下代码

我的文字是这样的:

category_arabic[3] = "محـامـون" ;

字体 tfarsi1 = Farsi.GetFarsiFont(this);

((TextView) pageView
                    .findViewById(R.id.menu_txtAttorneyLegalServices_ar))
                    .setTypeface(tfarsi1 );

((TextView) pageView
                    .findViewById(R.id.menu_txtAutoRepairSmog_ar))
                    .setText(Farsi.Convert(category_arabic[3]));

请给我一些解决这个问题的方法。我必须为此做什么?我还为此解决方案使用了 ArabicUtilities.java 文件,但没有得到正确的解决方案

最佳答案

您可以使用 ArabicUtilities.java 并使用“reshaper”功能 reshape 您的文本。例如:

textView1.setText(ArabicUtilities.reshape("نمايش"));

关于android - 阿拉伯文本显示问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9389350/

相关文章:

java - 尝试重新打开已关闭的对象: SQLiteQuery

java - 为什么 JUnit 找不到我的测试?

android - 调用与 fragment 分离的 asynctask 类

android - 在通过 Google Sign In 使用 Firebase 应用程序时,如何通过 Google Cloud Function 进行身份验证?

android - Android 模拟器上的 Google map V2

android - 如何在 Android Studio 中为演示和完整 flavor 代码创建适当的目录?

android - 将焦点设置到输入框并在 pageshow 上使用 jquery mobile 显示 android 键盘

android - 我应该在哪里调用 MobileAds.initialize()?

Android 4 OpenVPN App tun_builder_error (topology net30)

android - 无法从 Play 商店取消发布应用