2

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.

Community
  • 1
  • 1
Grace
  • 1,265
  • 21
  • 47

1 Answers1

2

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.

Shai
  • 25,159
  • 9
  • 44
  • 67
  • Hi Shai, thanks for the help, based on this link http://stackoverflow.com/questions/31697426/ios-9-disable-support-for-right-to-left-language they pointed out that this method is not a safe way and may lead to other issues, how true is that? – Grace Nov 16 '15 at 14:08
  • 1
    Thank you so much brother.It saved me from 3 days trying.I have been achieving for 3 days.Now only I get it by using your answer.So I up voted it. – user3182143 Mar 03 '17 at 07:37