开发者

what's the iphone bottom right Coordinates?

开发者 https://www.devze.com 2023-02-26 06:56 出处:网络
start point of the line is (0,0). What\'s the bottom right Coordinates? Thanks! 开发者_Python百科Dimensions of the device screen:

start point of the line is (0,0). What's the bottom right Coordinates?

Thanks!


what's the iphone bottom right Coordinates?

开发者_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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号