UIView's frame, bounds, center, origin, when to use what?

Posted by Boon on Stack Overflow See other posts from Stack Overflow or by Boon
Published on 2009-07-01T20:10:58Z Indexed on 2010/04/15 0:43 UTC
Read the original article Hit count: 640

Filed under:
|

UIView has the concept of frame, bounds, center, and origin, and they all seem to be interrelated. Most of the time, I deal with frame when setting the position and size of a UIView (or subclass). I understand that the frame is using global coordinate system and the bounds is using coordinate of the local view (therefore it's x and y are 0, but not always), but it's still confusing to me when to use what.

Question: Under what context (and what's the right time) the other properties (bounds, center, origin) should be used?

© Stack Overflow or respective owner

Related posts about uikit

Related posts about iphone-sdk