When would an UIView\'s bounds.origin
not be (0, 0)
?
This paragraph was helpful to me:
IMPORTANT!! Bounds X and Y, the
The bounds.origin will be negative if you initialize a view with negative width/height. For example, if you did
UIView* v = [[UIView alloc] initWithFrame:CGRectMake(5, 5, -10, -20)];
the frame would be:
origin = {
x = -5,
y = -15
},
size = {
width = 10,
height = 20
}
bounds:
origin = {
x = -10,
y = -20
},
size = {
width = 10,
height = 20
}
center:
x = 0,
y = -5
try it for yourself!