You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iOS has RTL mode for apps which makes quite serious difference when the app is supposed to be used in RTL or in LTR mode. The differences are:
App action-bar would place the back button automatically on the right side of the action-bar, and the arrow would point to right.
Pages when navigating would slide from left to right (as opposed to right to left for LTR apps).
Swiping gesture to navigate back starts from the right edge of the screen towards the left (as opposed to starting from left for LTR).
These differences make huge UX issue for RTL apps written in NativeScript when trying to use as much of the native look and feel on iOS.
I made a search on this over the past days, and found some interesting points, such as https://stackoverflow.com/a/42430254, which has a solution that is reported in one way or another across other SO answers and blog posts on the internet. I was able to translate the code to NativeScript with help from @williamjuan027 (thanks!) to this:
// Code is added to an event method to make sure it is running only when the UI is readyUIView.appearance().semanticContentAttribute=UISemanticContentAttribute.ForceLeftToRight;UINavigationBar.appearance().semanticContentAttribute=UISemanticContentAttribute.ForceLeftToRight;conststoryboard=newUIStoryboard();constvc=storyboard.instantiateInitialViewController();if(vc){UIApplication.sharedApplication.keyWindow.rootViewController=vc;}
However, it is transforming the app into a white screener, meaning it is working, but it is reloading the wrong storyboard/viewcontroller. Next I tried the following to get the current storyboard in order to try it:
However, I'm unable to figure out the correct combination for the storyboard name and the value for NSBundle (second parameter).
What am I messing with this and how can I get NativeScript to reload current view-controller in order to get the changes of semanticContentAttribute get into effect?
The text was updated successfully, but these errors were encountered:
In discussion with @xlmnxp, he confirmed that the snippet mentioned in the issue did work back then with NativeScript 6, and with NativeScript 7 this seems to have broken. Any thoughts on what might have changed and break this?
Regarding the layout direction thing, I think core could provide a layoutDirection property for start.
Text has more things to consider though, like the direction of paragraph style in iOS.
Hello.
iOS has RTL mode for apps which makes quite serious difference when the app is supposed to be used in RTL or in LTR mode. The differences are:
These differences make huge UX issue for RTL apps written in NativeScript when trying to use as much of the native look and feel on iOS.
I made a search on this over the past days, and found some interesting points, such as https://stackoverflow.com/a/42430254, which has a solution that is reported in one way or another across other SO answers and blog posts on the internet. I was able to translate the code to NativeScript with help from @williamjuan027 (thanks!) to this:
However, it is transforming the app into a white screener, meaning it is working, but it is reloading the wrong storyboard/viewcontroller. Next I tried the following to get the current storyboard in order to try it:
However, I'm unable to figure out the correct combination for the storyboard name and the value for
NSBundle
(second parameter).What am I messing with this and how can I get NativeScript to reload current view-controller in order to get the changes of
semanticContentAttribute
get into effect?The text was updated successfully, but these errors were encountered: