Android below 4.2 how to set layoutDirection to be RTL

后端 未结 3 901
情话喂你
情话喂你 2021-02-02 00:30

trying to set the layout elements to be RTL ordered

in 4.2 and above the line: layoutDirection=\"rtl\" and in the manifest: android:supportsRtl=\"true

3条回答
  •  执笔经年
    2021-02-02 00:58

    you can change your application language and solve this problem :

    String languageToLoad  = "en";
    Locale locale = new Locale(languageToLoad);
    Locale.setDefault(locale);
    Configuration config = new Configuration();
    config.locale = locale;
    getBaseContext().getResources().updateConfiguration(config,
    getBaseContext().getResources().getDisplayMetrics());
    

提交回复
热议问题