您的位置:首页 > 产品设计 > UI/UE

UINavigationController

2015-07-08 21:58 453 查看
UINavigationController处理屏幕旋转A simple UINavigationController subclass to handle iOS 6’s orientation changes better

#import <UIKit/UIKit.h>

@interface CJProperRotationNavigationController : UINavigationController

@end

#import "CJProperRotationNavigationController.h"

@implementation CJProperRotationNavigationController

- (BOOL)shouldAutorotate {
if (self.topViewController != nil)
return [self.topViewController shouldAutorotate];
else
return [super shouldAutorotate];
}

- (NSUInteger)supportedInterfaceOrientations {
if (self.topViewController != nil)
return [self.topViewController supportedInterfaceOrientations];
else
return [super supportedInterfaceOrientations];
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
if (self.topViewController != nil)
return [self.topViewController preferredInterfaceOrientationForPresentation];
else
return [super preferredInterfaceOrientationForPresentation];
}

@end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  navigaiton controller