Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LTR To RTL Using same xib in objective c

I am stuck to one point i want to develop a app that support LTR and RTL both but i don't want to create two .xib for LTR and RTL.

So can any one provide me any method avalable fot LTR to RTL using same xib.

thank you in advance.

like image 286
Hardik Vyas Avatar asked Nov 29 '25 16:11

Hardik Vyas


1 Answers

You can do this by changing the semantics

   self.anyView.semanticContentAttribute = .forceLeftToRight

OR

   self.anyView.semanticContentAttribute = .forceRightToLeft

In objective-c

 self.anyView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;

Or

 self.anyView.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;

see also this demo : RTLDemo

like image 183
Sh_Khan Avatar answered Dec 02 '25 07:12

Sh_Khan