Search code examples
objective-cxcodearabicright-to-left

Objective c Disable Autolayout Localization Behavior for Arabic


I have a code that does not use autolayout in its views and it is written in Obj-C.

I want to keep the view as it is (left to right) when is switched to Arabic language.

I know that there is a way of preventing this to happen if I was using autolayout constraints (Respect or not the Language Direction), but what if I am not using autolayout constraints and want to disable the feature that turns my app RTL direction for Arabic version?

Thanks for the help.


Solution

  • You can force your UIView's direction by using UISemanticContentAttribute

    i.e, to force Right to left direction, apply

    [myView setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
    

    On your view.