UINavigationController

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
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u014084081/article/details/46809069
文章标签: navigaiton controller
个人分类: iOS UI
上一篇UI效果
下一篇UIMenuController
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭