[英]enable landscape orientation in only one view on ios 6
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
-(BOOL)shouldAutorotate
{
return NO;
}
I just want to enable landscape orientation in only one view of my app.我只想在我的应用程序的一个视图中启用横向。 Other view must support the portrait mode only.
其他视图必须仅支持纵向模式。 But for iOS 6 its autorotate even I am using the latest methods of iOS 6. Expecting correct suggestion.
但是对于 iOS 6,即使我使用的是 iOS 6 的最新方法,它也会自动旋转。期待正确的建议。
For Portrait Only Orientation , try below method对于仅纵向方向,请尝试以下方法
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
- (BOOL)shouldAutorotate {
return FALSE;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.