iOS屏幕旋转的bug

来源:互联网 发布:php java 前景 编辑:程序博客网 时间:2024/06/06 19:52

控制屏幕旋转的方法如果不好使,那就创建一个navigationController的类目;

实现三个方法:


-(BOOL)shouldAutorotate {

    return [[self.viewControllers lastObject] shouldAutorotate];

}


-(NSUInteger)supportedInterfaceOrientations {

    return [[self.viewControllers lastObject] supportedInterfaceOrientations];

}


- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {

    return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];

}


当然原来的方法也要保留,不然也不好使。




0 0
原创粉丝点击