About CGRectMake
This will sound extremely silly and stupid, but I have touched a couple languages and they kind of messed up my sense of.... orientation or something:
In Objective-C, you can use开发者_开发技巧 CGRectMake(x,y,w,h) to make a rect. Cool.
So x,y set the... top left corner of the rect, or.... the center of the rect?
In UIKit, (x,y) is the upper-left corner.
Cocoa uses the Cartesian coordinate plane as its coordinate system (so (x, y) is set to the bottom-left corner). You can read more about the coordinate system in the Cocoa Drawing Guide.
精彩评论