首页 > 其他 > 详细

UITabBarControler解决旋转问题

时间:2015-09-14 13:50:31      阅读:227      评论:0      收藏:0      [点我收藏+]


在遇到开发项目中播放视频,播放视频回列表后,,列表 NavigationController 里边, NavigationController 在 UItabBarController 里边,不要旋转禁止的操作,我尝试了很多办法,于 UIViewController 写禁止旋转的方法,在 navigaitonController 类别里面写,都没有非常好地饿解决该旋转的方法,都没有解决该问题.

后来自己定义了 UITabBarController的类别才算攻克了该旋转的问题, 


#import <UIKit/UIKit.h>


@interface UITabBarController (TabBarRotation)


- (BOOL)shouldAutorotate;


- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation;


@end


#import "UITabBarController+Rotation.h"


@implementation UITabBarController (TabBarRotation)


- (BOOL)shouldAutorotate {


    return YES;


}


- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {

    return UIInterfaceOrientationPortrait;

}


@end



上面的一个类别能够解决 UITabBarController问题就出来了里面的旋转,


bo

版权声明:本文博主原创文章。博客,未经同意不得转载。

UITabBarControler解决旋转问题

原文:http://www.cnblogs.com/mengfanrong/p/4806843.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!