atlanteh atlanteh - 1 year ago 274
Android Question

RTL is forced in RTL devices

The new version of React Native has issued support for RTL devices:

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.
How can I force by app to use LTR?

Answer Source

I managed to fix this by adding:

import com.facebook.react.modules.i18nmanager.I18nUtil;

public void onCreate() {

    // FORCE LTR
    I18nUtil sharedI18nUtilInstance = I18nUtil.getInstance();
    sharedI18nUtilInstance.allowRTL(getApplicationContext(), false);