![[原创]ios <wbr>frame,bound和center Relationship between a view's frame and bounds](https://i-blog.csdnimg.cn/blog_migrate/a4c26d1e5885305701be709a3d33442f.gif)
Although you can change the frame
, bounds
, and center
-
When you set the
frame
property, the size value in the bounds
property changes to match the new size of the frame rectangle. The value in the center
property similarly changes to match the new center point of the frame rectangle. -
When you set the
center
property, the origin value in the frame
changes accordingly. -
When you set the size of the
bounds
property, the size value in the frame
property changes to match the new size of the bounds rectangle.
By default, a view’s frame is not clipped to its superview’s frame. Thus, any subviews that lie outside of their superview’s frame are rendered in their entirety. You can change this behavior, though, by setting the superview’s clipsToBounds
YES
. Regardless of whether or not subviews are clipped visually, touch events always respect the bounds rectangle of the target view’s superview. In other words, touch events occurring in a part of a view that lies outside of its superview’s bounds rectangle are not delivered to that view.