Skip to content

Instantly share code, notes, and snippets.

@msarsha
Last active October 5, 2019 08:45
Show Gist options
  • Save msarsha/fb007637f4536baa3fad1779eca4d587 to your computer and use it in GitHub Desktop.
Save msarsha/fb007637f4536baa3fad1779eca4d587 to your computer and use it in GitHub Desktop.
Force RTL layout for android and ios in NativeScript
android (main.ts):
app.android.addEventListener(app.AndroidApplication.activityCreatedEvent, (event: app.AndroidActivityEventData) => {
event.activity.getWindow().getDecorView().setLayoutDirection(android.view.View.LAYOUT_DIRECTION_RTL);
});
ios (app.component.ts):
UIView.appearance().semanticContentAttribute = 4;
@msarsha
Copy link
Author

msarsha commented Oct 5, 2019

For android add: android:supportsRtl="true"
in AndroidManifest.xml under the aplication tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment