start point of the line is (0,0). What's the bottom right Coordinates?
Thanks!
开发者_Python百科
Dimensions of the device screen:
[UIScreen mainScreen].bounds
Your apps window:
[[[UIApplication sharedApplication].delegate] window].bounds
Any view controller:
myViewController.view.bounds
All of these return a CGRect. The bottom right is:
CGPointMake(CGRectGetMaxX(myRect), CGRectGetMaxY(myRect));
CGPointMake(319.0f, 479.0f) it is.
Note: You may run into an upside-down flipped device-context depending on your way of drawing (CoreGraphics works that way)
It's different depending on several conditions.
1) Is it an iPhone 3 or 4?
2) Is the status bar at the top?
3) Are you using a navigation controller that is visible?
4) Are you using relative or absolute coordinates?
iPhone 3 absolutes would 319, 479
iPhone 4 absolutes would be 639,959
That's assuming no status bar. If you have anything at the top, you would need to subtract those heights.
精彩评论