我正在开发应用程序并在Xcode 5上开发。应用程序适用于从iOS 5到iOS 7的iPad支持。我将应用限制在左侧和右侧,这是在plist和项目设置中定义的。 此外,通过代码 在应用程序委托在Xcode 5中限制iOS 5横版的自动旋转
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskLandscape;
}
定义在类
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
但是发生了什么事,它工作正常,在iOS 7和iOS 6,但它总是旋转到iOS 5时设备移动肖像。我卡在这里如何限制这只在景观。请帮助我。提前致谢。
不适用于iOS 5 ... – iPatel
是...在6.0之后弃用它。 – KethanKumar
抱歉没有工作!!!! :( – josh