在 iOS 上,如果我们改变一个视图的frame
,我们改变它的bounds
,如果我们改变它的bounds
,我们改变它的frame
。
但是我们可以通过以下方式改变视图的内部坐标系:
CGRect b = v.bounds; // v is the UIView object
b.origin.x = 10000;
b.origin.y = 10000;
v.bounds = b;
现在,视图的左上角是 的坐标(10000, 10000)
。这是否也可以通过仅更改frame
而center
不是更改来实现bounds
?