天天看点

IOS 6 APP启动时设置默认方向,并保持不自动旋转

在继承自UIViewController的类中重写下面两个方法

- (NSUInteger) supportedInterfaceOrientations{

#ifdef __IPHONE_6_0

    // 想要设置的方向

    return UIInterfaceOrientationMaskLandscapeRight;

#endif

}

// 允许自动旋转

- (BOOL) shouldAutorotate {

    return YES;

}