RTL is forced in RTL devices

前端 未结 4 1956
粉色の甜心
粉色の甜心 2021-01-31 17:38

The new version of React Native has issued support for RTL devices: https://facebook.github.io/react-native/blog/2016/08/19/right-to-left-support-for-react-native-apps.html

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 18:01

    I managed to fix this by adding to MainApplication.java:

    import com.facebook.react.modules.i18nmanager.I18nUtil;
    
    public class MainApplication extends Application implements ReactApplication {
        @Override
        public void onCreate() {
            super.onCreate();
    
            // FORCE LTR
            I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
            sharedI18nUtilInstance.allowRTL(getApplicationContext(), false);
            ....
        }
    }
    

提交回复
热议问题