开发者

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)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜