我正在开发Android应用程序,并且当我在Android手机上尝试使用阿拉伯文语言对齐的文本视图和编辑文本更改时我不想改变他们。如果语言从英语更改为阿拉伯语,如何使布局对齐不会更改Android开发
例子:(TextView中)(EditText上)这个时候,手机语言英语 时语言更改为阿拉伯语布局更改为(EditText上)(TextView的) 我希望他们(的TextView)(EditText上)甚至如果手机语言是阿拉伯语或英语。
我正在开发Android应用程序,并且当我在Android手机上尝试使用阿拉伯文语言对齐的文本视图和编辑文本更改时我不想改变他们。如果语言从英语更改为阿拉伯语,如何使布局对齐不会更改Android开发
例子:(TextView中)(EditText上)这个时候,手机语言英语 时语言更改为阿拉伯语布局更改为(EditText上)(TextView的) 我希望他们(的TextView)(EditText上)甚至如果手机语言是阿拉伯语或英语。
在您的应用清单中声明您的应用支持RTL镜像。
具体来说,在您的清单文件中添加
android:supportsRtl="true" to the <application> element
。
上启动应用程序的更多refer here
设置应用程序的语言环境。在您的应用程序布局不会更改任何设备特定的区域设置后。
Locale locale = new Locale("us"); //US English Locale
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config,
getBaseContext().getResources().getDisplayMetrics());