User Interface for Arabic English iPhone using autoresize?

Hello, I want to convert the entire user interface to Arabic [from right to left] If the user changes his language from the settings and open the application.

I have a request below

1) Do I need to create a separate user interface for each? 2) Is there a short way to achieve this? 3) I need a full user interface that needs to be transformed as a mirror, which is on the left side [slide menu], to be on the right side, etc. .... 4) Xcode 8.2 again autoresist with automatic layout, I can Am I doing this without auto-linking?

+7
ios iphone xcode autolayout autoresize
source share
1 answer
  • No, you only create one user interface, regardless of language.

  • yes, there is a shortcut, you should use localization. apple doc for internationalization

  • UI conversion is performed by iOS (this is only true for uikit controllers. see below).

  • auotlayout has nothing to do with localization. As a rule, it is better to use autorun, otherwise you need to calculate the sizes of different screens. again, it has nothing to do with localization. see below.

edit: if you want to mirror your own views, for example, uiimage and uilabel. then you must do it yourself either with autoload or with frames. if you use uinavigation or tabbarcontroller, these controllers will be mirrored by iOS. therefore, you must take care of viewing the content yourself. You can create various constraints and set them at runtime. but if your views are very complex, you have to create 2 different storyboards, one for left to right and one for right to left, and load the corresponding storyboard at application launch time.

re-editing: so here is my application in English. and my application does not support rights to left languages

english

now, if I add, say, a language from right to left, such as Arabic: arabic

as you can see the table cells are automatically converted by iOS. and I just added internationalization for Arabic in English, German and so on. therefore, if you use UIKit controls in appropriate places, then it will automatically convert. But if your application is very customized and has a complex hierarchy of views, then iOS cannot help, then you have to do it yourself. if you follow a standard and simple hierarchy. then you should not worry too much about it. just check it out and see it for yourself.

so in my application, for example, all I have to do is translate the string into the language from right to left.

change here is the correct information apple document regarding issue number 4

Use the automatic layout to lay out your views relative to each other without a fixed origin, width and height, so that the views change and change accordingly when the language or locale changes. The automatic layout allows you to have one set of .storyboard and .xib files for all languages.

+1
source share

All Articles