1 bounds
IMPORTANT!! Bounds X and Y, the origin, are for moving inside the View. For eample X+5, moving 5pix to the left of the frame’s origin meaning draw all content within this View to the left 5pix of frame’s origin. It doesn’t do anything to itself, it is what being drew on it that get affected.
bounds 的 x 和 y,即 origin, 是为了移动内部的子视图。例如将bounds的 x+5 ,会将视图内所有子视图frame的origin向左移动5pix。但对于视图本身不会的位置造成影响,只会对视图内部绘制的view产生影响。
2 bounds 什么情况下默认不为(0,0)
初始化视图时,如果view 的width/height 为负数,则bounds默认不为0。
//使用负数初始化视图
UIView* v = [[UIView alloc] initWithFrame:CGRectMake(5, 5<