问题
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:
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"));
来源:https://stackoverflow.com/questions/33003948/android-locale-builder-doesnt-mirror-the-page-in-right-to-left-locales