React-native support RTL and LTR without changing device language

假装没事ソ 提交于 2019-12-11 15:50:05

问题


I have used react-native-i18n package for supporting international language. It is working but now I want my application can change RTL and LTR inside application according to language without changing device language. I used native base components in my application. So I cannot change their styling and If it is possible then How?

I have created settings option to change language and it is changing but how to change LTR to RTL and RTL to LTR all the components of application. If there is any solution please let me know.


回答1:


from the react-native docs:

direction specifies the directional flow of the user interface. The default is inherit, except for root node which will have value based on the current locale.

this means if you change the top View style direction to "rtl" all child components should inherit the direction.



来源:https://stackoverflow.com/questions/53554153/react-native-support-rtl-and-ltr-without-changing-device-language

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