Android strings.xml resource - arabic language and dynamic formatted strings

泄露秘密 提交于 2019-12-05 05:11:26
Fahim

Try adding a RIGHT-TO-LEFT MARK character (\u200F) at the start of your text.

similar type answered here

That is a sublime issue with Right-to-Left languages as listed here. You dont have to worry too much about it because it does not affect the results, your app will show it perfectly.

"To solve this problem, use the unicodeWrap() method, found in the BidiFormatter class, on every piece of text that you insert into a localized message."

Quoted from here https://developer.android.com/training/basics/supporting-devices/languages.html#FormatText

You have to use Arabic Font like:

Typeface face = Typeface.createFromAsset(this.getAssets(), "fonts/arabic_letters.TTF");
yourTextView = (TextView) findViewById(R.id.yourTextVIew);
yourTextView.setTypeface(face, Typeface.BOLD);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!