Force LTR on Expo on Android

笑着哭i 提交于 2020-05-15 02:43:04

问题


I am creating an app with React Native with Expo and I can't find a solution do force LTR (left-to-right) direction. Some of my users have its phone with RTL languages, but I only have English and Norwegian, so it doesn't make sense to show text in RTL in English.

I am also using i18next for translation.

Any ideas on how to solve this? Force LTR.


回答1:


Just found my solution after more digging.

On App.js import the following library:

import { I18nManager } from "react-native";

Then right after the imports use the following code:

I18nManager.forceRTL(false);
I18nManager.allowRTL(false);


来源:https://stackoverflow.com/questions/58446637/force-ltr-on-expo-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!