Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"UIScreen mainScreen] applicationFrame]" for Landscape mode

I have to ask it. Using

[[UIScreen mainScreen] applicationFrame]

Is a beautiful way to get the working area of the iphone or ipad in portrait mode. But, if I want get the same size in landscape, there are other code, or I will have to create:

CGRect landscape = CGRectMake(0, 20, 1024, 748)

This is even not generic for iPhone and iPad.

like image 692
Rodrigo Avatar asked Aug 03 '11 17:08

Rodrigo


1 Answers

You can use [[[UIApplication sharedApplication] keyWindow] frame]

like image 86
Angelo Avatar answered Sep 18 '22 15:09

Angelo