您的位置:首页 > 其它

[XCode] Frame Rectangle 和 Alignment Rectangle 的区别

2015-12-04 10:10 288 查看
参考:http://stackoverflow.com/questions/28152533/difference-between-frame-rectangle-and-alignment-rectangle



如上图,XCode中编辑界面元素,“Size Inspector”中的 View -> Show 可以有两种选择:Frame Rectangle 和 Alignment Rectangle。

根据 http://stackoverflow.com/questions/28152533/difference-between-frame-rectangle-and-alignment-rectangle 介绍,区别大致如下:



一个UI元素的区域有两种:可见区域、Frame区域。以上图的button为例,一个button的可见区域就是那个左右圆角的矩形,而这个button的 Frame区域 通常情况下会比 可见区域 大,如上图,这个button的 Frame区域 可能就是在可见区域外部的一个矩形包围盒。

类似的,Frame Rectangle 指的就是外围包围盒的位置和尺寸,Alignment Rectangle 是和 UI 元素的可见区域相关的。此外,XCode 的 Auto Layout 是通过 Alignment Rectangle 而不是 Frame Rectangle 来实现的。如上图,右对齐的虚线是和这个button的可见区域的右边缘对齐的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: