[英]Launch app Iphone portrait, and Ipad landscape
I have this code, i need detect is ipad launch app landscape or iphone in portrait mode only 我有此代码,我需要检测的是ipad启动应用程序横向还是仅纵向模式下的iphone
NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType isEqualToString:@"iPhone"])
{
NSLog(@"This is iPhone");
}
else
{
NSLog(@"This is iPad");
}
This works!!! 这有效!!! for IOS 6
对于IOS 6
-(NSUInteger)supportedInterfaceOrientations{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
return UIInterfaceOrientationMaskPortrait;
else
return UIInterfaceOrientationMaskLandscape;
}
- (BOOL)shouldAutorotate {
return YES;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.