视图框架与视图绑定+ iPhone之间的差异 [英] Difference between view's frame and view's bound + iPhone

查看:103
本文介绍了视图框架与视图绑定+ iPhone之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道UIView的'frame'和'bound'属性有什么区别。我使用这两个属性得到相同的结果。我无法弄清楚两者之间的区别..

I want to know what is the difference between 'frame' and 'bound' property of UIView. I get the same results using both properties. I can not figure out the difference between the two..

提前完成。

推荐答案

框架是超视图中视图的位置,使用superview的坐标系。

The frame is the view's location in its superview, using the superview's coordinate system.

边界是视图在自己坐标系中的位置和大小。

The bounds is the view's location and size in its own coordinate system.

如果两个属性的结果相同,则表示视图填充其超级视图,两个视图都以(0,0)为原点。尝试更改框架,您将看到它在其超级视图中移动到不同的位置。

If you are getting the same results for both properties, it means that the view fills its superview, and both views have (0, 0) as the origin. Try changing the frame, and you will see it move to different positions within its superview.

这篇关于视图框架与视图绑定+ iPhone之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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