6

[UIScreen mainScreen].bounds returns (0,0,768,1024) even when the iPad is in Landscape mode.

It should return (0,0,1024,768) but instead it returns (0,0,768,1024).

What could be wrong?

halfer
  • 19,824
  • 17
  • 99
  • 186
Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
  • 1
    When are you pulling the CGRect with the erroneous values? Before/during/after the rotation animation? –  Aug 19 '11 at 10:14
  • [This chap](http://jomnius.blogspot.com/2011/03/beware-using-uiscreen-mainscreenbounds.html) had a similar problem. Can you do like him and get bounds from a better-behaved object? – Xav Aug 19 '11 at 10:17
  • @Sold Out Activist: I am launching the app in landscape mode so it is before rotation.So Rotation is not involved in this. – Parth Bhatt Aug 19 '11 at 11:08
  • 1
    Note that on iOS 8, the behavior has changed so that the value returned by `bounds` does depend on the orientation. – ThomasW Sep 24 '14 at 03:45

1 Answers1

6

Nothing's wrong. This is how it works unfortunately.

See this question: Returning incorrect rectangle on landscape application launch

Community
  • 1
  • 1
ageektrapped
  • 14,482
  • 7
  • 57
  • 72