NSLayoutAttributeLeft与NSLayoutAttributeLeading之间的区别 [英] Difference between NSLayoutAttributeLeft vs NSLayoutAttributeLeading

查看:318
本文介绍了NSLayoutAttributeLeft与NSLayoutAttributeLeading之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS自动布局中 NSLayoutAttributeLeft NSLayoutAttributeLeading 有什么区别?

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

推荐答案

领导并不总是意味着左。
对于RTL编写的语言(语言环境),对象的对齐矩形的前沿将位于对象的右侧。

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

来自自动布局指南


对于从左到右的语言(如英语),前导和尾随属性与左右相同,但在从右到左的环境,如希伯来语或阿拉伯语,前导和尾随与左右相同。创建约束时,前导和尾随是默认值。您通常应该使用前导和尾随来确保您的界面以所有语言正确布局,除非您制定的约束应该保持不变,无论语言如何(例如拆分视图中的主窗格和详细窗格的顺序)。

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).

这篇关于NSLayoutAttributeLeft与NSLayoutAttributeLeading之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆