Created
July 13, 2012 00:43
-
-
Save venkatd/3102064 to your computer and use it in GitHub Desktop.
iphone screen dimensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGRect rect; | |
// Get screen dimensions | |
rect = [[UIScreen mainScreen] bounds]; | |
NSLog(@"Bounds: %1.0f, %1.0f, %1.0f, %1.0f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); | |
// Get application frame dimensions (basically screen - status bar) | |
rect = [[UIScreen mainScreen] applicationFrame]; | |
NSLog(@"App Frame: %1.0f, %1.0f, %1.0f, %1.0f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); | |
// Get status bar frame dimensions | |
rect = [[UIApplication sharedApplication] statusBarFrame]; | |
NSLog(@"Statusbar frame: %1.0f, %1.0f, %1.0f, %1.0f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment