I18nManager.forceRTL doesn't applies changes in first app load

后端 未结 5 1777
一生所求
一生所求 2021-02-18 21:37

I have an app that created by awesome React-native and my layout designed to be in RTL mode. I\'ve set up an option for forcing the layout to be RT

5条回答
  •  粉色の甜心
    2021-02-18 22:18

    I went through the same issue this helped me. This is abit modified answer without the need to use redux.

    First you check current state with I18nManager.isRTL then forceRTL if not and restart with react-native-restart.

       constructor(props) {          
          //Force RTL
          if(!I18nManager.isRTL){
             I18nManager.forceRTL(true);
             RNRestart.Restart();
          }
       }
    

提交回复
热议问题