天天看點

IOS 6 APP啟動時設定預設方向,并保持不自動旋轉

在繼承自UIViewController的類中重寫下面兩個方法

- (NSUInteger) supportedInterfaceOrientations{

#ifdef __IPHONE_6_0

    // 想要設定的方向

    return UIInterfaceOrientationMaskLandscapeRight;

#endif

}

// 允許自動旋轉

- (BOOL) shouldAutorotate {

    return YES;

}