Set LayoutDirection (RTL) for api lower than 17

后端 未结 2 1931
不思量自难忘°
不思量自难忘° 2020-12-14 15:32

I am going to build a Persian app (RTL). my app includes a ListView and a Navigation Drawer .

I added in Manifest in application tag

2条回答
  •  情书的邮戳
    2020-12-14 16:15

    Just concatenate every string that you want to set in textView with "\u202B"

    it just enforces the text to be RTL.

    String textWhichIsLTR = "LTR or RTL text that you want to enforce to RTL";
    String enforcedRTL = textWhichIsLTR + "\u202B";
    fooTextView.setText(enforcedRTL);
    

提交回复
热议问题