简体   繁体   English

在 ios 6 上仅在一个视图中启用横向

[英]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.

相关问题 一种View Controller iOS的横向 - Landscape orientation for one view controller ios 强制iOS方向在一个模态视图控制器上横向移动 - Force iOS orientation to landscape on one modal view controller iOS-在横向加载新视图时遇到问题? - iOS - Problem loading a new view in a landscape orientation? 方向仅在相机重叠视图中处于横向模式 - Orientation is only in landscape mode in cameraoverlay view 如何为IOS6中的MPMoviePlayerController仅提供一个带有风景的视图 - how to provide only one view with landscape for MPMoviePlayerController in IOS6 iPhone iOS 6 UITabBarController仅限于纵向,如何使Modal View Controller支持横向方向 - iPhone iOS 6 UITabBarController Portrait Only, How to have Modal View Controller support Landscape Orientation iOS:如何更改应用程序中仅一个视图控制器的方向? - iOS: How to change Orientation of only one view controller in app? 在UISplitViewController中为仅一个视图控制器在横向模式下为主视图启用设置显示/隐藏 - Set show/hide for master view enable in UISplitViewController for only one view controller in landscape mode iOS 6横向定位问题 - iOS 6 landscape orientation problems iOS 8设备方向 - ios 8 device orientation landscape
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM