daramasala
daramasala

Reputation: 3030

Force RTL for Xamarin.iOS app

My app's interface is always in Hebrew which is an RTL language.

How can I force iOS to show my app in RTL?

Right now, if the device language is, e.g., Hebrew, then the app displays in RTL correctly.

But if the device language is English then the app displays in LTR. Since the app is always in Hebrew, I want to force iOS to use RTL even if the device's language is English.

The app targets iOS 9 and higher.

I added Localizations key in info.plist with an array value with a single element 'he' but it did not help.

Upvotes: 2

Views: 911

Answers (2)

Rabih harb
Rabih harb

Reputation: 1382

Daramasala's solution works if your app is set to use one language

the below will work with multiple languages,

check solution here

RTL xamarin forms during startup and runtime - force layout RTL

Upvotes: 0

daramasala
daramasala

Reputation: 3030

Turns out Xamarin creates an en.lproj folder in the project. When I removed this folder I got an RTL only app.

To summarize:

  1. Remove any localizations from the app, i.e. the en.lproj folder.
  2. Add Localizations array in info.plist and add a single value he.

Together this makes iOS understand that the app is only localized to Hebrew and always display it as RTL.

Upvotes: 1

Related Questions