iphone - iOS 6 自动旋转仅适用于多个 ViewController 应用程序中的 SingleViewController

标签 iphone xcode ios6

有没有办法为 SingleViewController 提供自动旋转,因为我们的 iPhone 应用程序有多个 ViewController,并且只需要为一个 ViewController 进行自动旋转。

最佳答案

是的,您可以用于 VC(不旋转)

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

    {
        //return (interfaceOrientation == UIInterfaceOrientationPortrait);
        return NO;
    }
// New Autorotation support for iOS 6.
- (BOOL)shouldAutorotate NS_AVAILABLE_IOS(6_0);
{
     Return NO;
    }

另请参阅Apple Doc 这会很有帮助。

关于iphone - iOS 6 自动旋转仅适用于多个 ViewController 应用程序中的 SingleViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13507056/

相关文章:

ios - "The view hierarchy is not prepared for the constraint" swift 3 错误

ios - 如何使用 Swiftui 在 uitableviewcell 中添加 View ?

ios - 在 iOS 中解析和接收电子邮件

iphone - OS 4 上的平滑注释移动

iphone - 相对于 View 的 CGPoint

ios - Core Data 为单个属性过滤结果并设置一个 UILabel 的文本

ios - 将 UIImage 转换为数据 URI

ios - 缺乏理解崩溃报告

iphone - 在 iOS 上与 facebook、twitter 分享

iphone - 如何获得精确的时间,例如 Objective-C 中的毫秒数?