获取iphone手机屏幕分辨率

//1 Available in iOS 4.0 and later
UIScreen *MainScreen = [UIScreen mainScreen];
CGSize Size = [MainScreen bounds].size;
CGFloat scale = [MainScreen scale];
CGFloat screenWidth = Size.width * scale;
CGFloat screenHeight = Size.height * scale;    

//2 Available in iOS 3.2 and later

UIScreen *MainScreen = [UIScreen mainScreen];
UIScreenMode *ScreenMode = [MainScreen currentMode];
CGSize Size = [ScreenMode size];
CGFloat screenWidth = Size.width;
CGFloat screenHeight = Size.height;

你可能感兴趣的:(获取iphone手机屏幕分辨率)