android Locale.Builder() doesn't mirror the pa

2019-07-13 13:02发布

When I use

locale = new Locale("ar"); 

the screen is mirrored in the right way.

In order to give the option to set the numeric system, i have to use the Locale.Builder() inserted with lollipop.

locale = new Locale.Builder().setLanguage("ar").setRegion("MA").setExtension(Locale.UNICODE_LOCALE_EXTENSION, "nu-latn").build();

The problem is that in this way the screen is not mirrored properly. There is a way, like an Extension, to set the rtl attribute?

1条回答
放荡不羁爱自由
2楼-- · 2019-07-13 13:08

SOLUTION: In order to mirror the screen properly, you have to use the Configuration.

Configuration config = new Configuration();
config.locale = locale;
config.setLayoutDirection(new Locale("ar"));
查看更多
登录 后发表回答