How to get the frame size (orientation dependent) in Objective-C?
I used [[UIScreen mainScreen] bounds] to get the frame size in Objective-C, for example 1024x768 in iPad.
However, when I switch the screen orientation, like from portrait to landscape, [[UIScreen mainScreen] bounds] still returns the same value.
How to get the frame size (orientation dep开发者_StackOverflow社区endent) ? (For example, 1024x768 when in portrait and 768x1024 in landscape)
Thanks
Update: problem solved.
Try with
CGRect rect = [UIScreen mainScreen].applicationFrame ;
it will return you frame of application screen area in points (i.e. entire screen minus status bar if visible)
精彩评论