-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
See:
https://reactnative.dev/blog/2016/08/19/right-to-left-support-for-react-native-apps
Relevant section:
Making an App RTL-ready
To support RTL, you should first add the RTL language bundles to your app.
See the general guides from iOS and Android.
Allow RTL layout for your app by calling the allowRTL() function at the beginning of native code. We provided this utility to only apply to an RTL layout when your app is ready. Here is an example:
iOS:
// in AppDelegate.m
[[RCTI18nUtil sharedInstance] allowRTL:YES];
Android:
// in MainActivity.java
I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
sharedI18nUtilInstance.allowRTL(context, true);
For Android, you need add android:supportsRtl="true" to the element in AndroidManifest.xml file.
Now, when you recompile your app and change the device language to an RTL language (e.g. Arabic or Hebrew), your app layout should change to RTL automatically.