![](/img/trans.png)
[英]App support the app Landscape and portrait mode in both ipad and iphone
[英]Launch app Iphone portrait, and Ipad landscape
我有此代码,我需要检测的是ipad启动应用程序横向还是仅纵向模式下的iphone
NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType isEqualToString:@"iPhone"])
{
NSLog(@"This is iPhone");
}
else
{
NSLog(@"This is iPad");
}
这有效!!! 对于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.