Force LTR on Expo on Android(在 Android 上的 Expo 上强制 LTR)
问题描述
我正在使用带有 Expo 的 React Native 创建一个应用程序,但我找不到强制 LTR(从左到右)方向的解决方案.我的一些用户的手机支持 RTL 语言,但我只有英语和挪威语,所以用英语在 RTL 中显示文本没有意义.
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.
我也在使用 i18next 进行翻译.
I am also using i18next for translation.
关于如何解决这个问题的任何想法?强制 LTR.
Any ideas on how to solve this? Force LTR.
推荐答案
经过更多的挖掘才找到我的解决方案.
Just found my solution after more digging.
在 App.js 上导入以下库:
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);
这篇关于在 Android 上的 Expo 上强制 LTR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Android 上的 Expo 上强制 LTR
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
