Disable Autolayout Localization Behavior (RTL - Right To Left Behavior )

前端 未结 4 868
予麋鹿
予麋鹿 2020-12-08 14:19

My application is localized in both English and Arabic.

Unfortunately, sometimes the autolayout behavior for localization is not required. By that, I mean reversing

4条回答
  •  伪装坚强ぢ
    2020-12-08 15:10

    The attributes leading and trailing are the same as left and right for left-to-right languages such as English, but in a right-to-left environment such as Hebrew or Arabic, leading and trailing are the same as right and left. When you create constraints, leading and trailing are the default values. You should usually use leading and trailing to make sure your interface is laid out appropriately in all languages, unless you’re making constraints that should remain the same regardless of language.

    So, for your special cases, don't use leading and trailing, instead, explicitly use left and right when you create your constraints.

提交回复
热议问题