-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTL is forced in android RTL devices #10204
Comments
this happens to me to. |
Isn't there a way to do this though the js code to work on both android and ios? |
@kfiroo It can't seem to resolve I18nManager |
@DeDuckProject Sorry for the confusion, this is from my JS code const ReactNative = require('react-native');
try {
ReactNative.I18nManager.allowRTL(false);
} catch (e) {
console.log(e);
} |
@kfiroo thanks, works like a charm |
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
@kfiroo its still not working on some devices, I used this instead: https://stackoverflow.com/questions/39815309/rtl-is-forced-in-rtl-devices
|
All the solutions here do force LTR view, but do not resolve deep issues within components that lack proper support for RTL, such as the react-native Slider, which still doesn't render correctly. The solution for Android is to add https://stackoverflow.com/questions/39817683/forcing-the-app-to-work-as-ltr |
thanks @dekelev
did not forced LTR for |
Went through the solutions and RTL is still forced on Text that starts with an Arabic character. What worked for me (as a rather hacky solution) was adding in the Unicode character "LEFT-TO-RIGHT ISOLATE" at the start. <Text>{'\u2066'} أهْلًا وَسَهْلاً Ahlan wa Sahlan!</Text> My attempts otherwise have been the following: // index.js
import { I18nManager } from 'react-native';
I18nManager.allowRTL(false); <!-- styles.xml -->
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:gravity">left</item>
<item name="android:layoutDirection">ltr</item>
<item name="android:textDirection">ltr</item>
<item name="android:textAlignment">textStart</item>
</style>
</resources> <!-- AndroidManifest.xml -->
<application
android:supportsRtl="false"
.... As well as the example above to force I18n to go LTR on Java. |
Issue Description
The new version of React Native has issued support for RTL devices:
https://facebook.github.io/react-native/blog/2016/08/19/right-to-left-support-for-react-native-apps.html
However, it seems that in RTL android devices the RTL layout is forced and there's no way to change it so now all apps are broken for RTL devices.
I opened an issue in Stackoverflow Here, and then managed to solve this problem by forcing LTR in android code like so:
But this is just a hack. Still, anyone who has react-native@0.34.0 will have his entire app flipped when used in RTL android devices even without actively allowing RTL.
Steps to Reproduce / Code Snippets
Expected Results
Left text to be on the left side & Right text to be on the right side.
Actual Results
Left text is on the right side & Right text is on the left side.
Additional Information
The text was updated successfully, but these errors were encountered: