假设我在res / values / strings.xml中具有默认字符串。他们是英文的。 AndroidManifest.xml中的android:supportsRtl =“ true”。
使用希伯来语系统语言的用户打开我的应用程序,他们看到从右到左绘制的所有英文字符串。
是否可以指定默认语言环境为LTR?我试图设置tools:locale =“ en”,但这没有帮助。
我认为禁用“ supportsRtl”不是一个好主意。例如,如果我有阿拉伯语翻译,则希望将其显示为RTL。但是对于希伯来语用户,它应该是默认的英语版本LTR。
请帮助。
答案 0 :(得分:0)
在布局加载之前设置此代码。
Configuration config = new Configuration();
config.locale = new Locale("set default local language");
getBaseContext().getResources().updateConfiguration(config,getBaseContext().getResources().getDisplayMetrics());