美文网首页
Frame Bounds and Center

Frame Bounds and Center

作者: r_lin | 来源:发表于2015-11-30 18:00 被阅读103次

我们通常用view的frame、bounds和center来决定view的几何位置。在坐标系中,通过frame我们可以决定view在其父视图(superview)中的位置和大小。bounds表示的是view自己的坐标系统,通常用于改变view自身。bounds和frame的size是相关联的,改变他们中任一个的size都会使另一个跟着改变。center用于调整view的位置而无需改变view的大小。

参考下图:



View B’s bounds= ((0,0),(200,250))

View B’s frame= ((140,65),(320,320))

View B’s center= (300,225)

相关文章

网友评论

      本文标题:Frame Bounds and Center

      本文链接:https://www.haomeiwen.com/subject/utsjhttx.html