Difference between NSLayoutAttributeLeft vs NSLayoutAttributeLeading

一个人想着一个人 提交于 2019-12-20 10:28:53

问题


What is the difference between NSLayoutAttributeLeft and NSLayoutAttributeLeading in iOS autolayouts?


回答1:


"Leading" does not always mean "Left". For RTL-written languages (locales) leading edge of the object’s alignment rectangle will be located at the right side of the object.

Quote from Auto Layout Guide:

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 (such as the order of master and detail panes in a split view).



来源:https://stackoverflow.com/questions/19971508/difference-between-nslayoutattributeleft-vs-nslayoutattributeleading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!