在繼承自UIViewController的類中重寫下面兩個方法
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
// 想要設定的方向
return UIInterfaceOrientationMaskLandscapeRight;
#endif
}
// 允許自動旋轉
- (BOOL) shouldAutorotate {
return YES;
}
在繼承自UIViewController的類中重寫下面兩個方法
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
// 想要設定的方向
return UIInterfaceOrientationMaskLandscapeRight;
#endif
}
// 允許自動旋轉
- (BOOL) shouldAutorotate {
return YES;
}