user503853
user503853

Reputation:

what's the iphone bottom right Coordinates?

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

Thanks!


enter image description here

Upvotes: 1

Views: 242

Answers (3)

XJones
XJones

Reputation: 21967

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));

Upvotes: 3

Mikecito
Mikecito

Reputation: 2063

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.

Upvotes: 0

Till
Till

Reputation: 27597

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)

Upvotes: 1

Related Questions