React Native-iOS中的RTL [英] React native - rtl in ios
本文介绍了React Native-iOS中的RTL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
首先,我在android上工作,并且RTL运行良好,我添加了以下代码:
firstly i worked on android and the RTL working good, i added the following code:
I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
sharedI18nUtilInstance.setAllowRTL(context, true);
到MainActivity.java和
to MainActivity.java and
android:supportsRtl="true"
到AndroidManifest.xml
to AndroidManifest.xml
并在js代码中:
I18nManager.forceRTL(true);
现在是问题所在:我试图在ios上设置rtl,但无法正常工作我添加了
Now is the problem: i tried to set rtl on ios but its not working i added
// in AppDelegate.m
[[RCTI18nUtil sharedInstance] allowRTL:YES];
和
I18nManager.forceRTL(true);
在js代码中但是所有的文本和flex仍然是ltr ...我该怎么办?
in js code but all the text and flex are still ltr... what can i do?
推荐答案
您必须在默认语言旁边添加一个RTL语言,它将起作用,可以找到更多信息
You must add an RTL Language beside default one and it'll work , more info can be found here
这篇关于React Native-iOS中的RTL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文