Showing posts with label Screen size. Show all posts
Showing posts with label Screen size. Show all posts

Saturday, February 11, 2012

Obtain the size of application screen

Obtain the size of application screen:

CGRect frame = [UIScreen mainScreen].applicationFrame; Or

CGRect frame = [UIScreen mainScreen] bounds];

Obtain the width of application screen (Same way for height):

UIWindow* window = [UIApplication sharedApplication].keyWindow;
float width = window.frame.size.width;
Or, float width = [UIScreen mainScreen] bounds].size.width;