二者都是方的。
bounds 对内 不包含自身 相对 superView的 位置
frame 对外 包括自身相对 superView的坐标
self.bounds= CGRectMake(0,0,self.frame.size.witdh,frame.size.height);
官方解释:he frame property contains a rectangle, the frame rectangle, that specifies the view’s location and size relative to its parent view’s coordinate system. The bounds property contains a rectangle, the bounds rectangle, that defines the view’s position and size relative to its own local coordinate system. And although the origin of the bounds rectangle is typically set to (0, 0), it need not be.
本文详细解析了iOS开发中视图的frame与bounds属性的区别。frame属性定义了视图相对于父视图坐标系统的定位和大小,而bounds属性则定义了视图在其自身局部坐标系统中的位置和大小。虽然bounds原点通常设置为(0,0),但并不一定如此。
1771





