As suggested by Maddy, for your use case you just change the frame
. Here is what happens behind the scenes:
Changing the frame is like changing bounds
and center
of the view. So if you want to use bounds
, also change the center
. Please note that the size
of the frame
is not necessarily the same as the size of the
bounds` because the view might be rotated.
Therefore, your statement "I thought that a view only draws into it's bounds rect." is if not incorrect at least not precise enough. If you rotate your {200,200}
view by 45 degrees, its bounds
would still be {200,200}
, but its frame.size
will be 200 * sqrt(2)
for both width and height. The bounds
refer to the view's own coordinate system, the frame
to that of the superview.