创建的universal的工程,如何让iPhone默认启动竖屏,iPad默认启动横屏

2024-12-12 12:45:30
推荐回答(2个)
回答1:

在 ****ViewController.m中添加以下函数

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
return YES;

return NO;
}

答案来源于网络

回答2:

自问自答一下,plist中可以分别设置的 UISupportedInterfaceOrientations~iphone UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UISupportedInterfaceOrientations~ipad UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight