UIView 的属性
@property(nonatomic) BOOL clipsToBounds;
// When YES, content and subviews are clipped to the bounds of the view. Default is NO.
如题,有两个view: view1,view2
view2添加view1到中,如果view2大于view1,或者view2的坐标不全在view1的范围内,view2是盖着view1的,意思就是超出的部份也会画出来
如果,我们想要view2把超出的那部份隐藏起来的话,就得改变它的父视图也就view1的clipsTobounds属性值。
view1.clipsTobounds = YES;