iOS---iphone----ipad 横竖屏监听的方法
来源:互联网 发布:淘宝天下 诈骗 编辑:程序博客网 时间:2024/06/05 17:44
//不推荐使用
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
//推荐
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(change) name:UIDeviceOrientationDidChangeNotification object:nil];
}
- (void)change
{
if([[UIDevice currentDevice] orientation] == UIInterfaceOrientationMaskPortrait)
{
[self.cellBtn setHidden:NO];
[self.leftVC.view setFrame:CGRectMake(0, 64, 300, self.view.current_h-64-49)];
}
if([[UIDevice currentDevice] orientation] == UIInterfaceOrientationLandscapeLeft)
{
[self.cellBtn setHidden:YES];
[self.leftVC.view setFrame:CGRectMake(0, 64, 400, self.view.current_h-64-49)];
{
if([[UIDevice currentDevice] orientation] == UIInterfaceOrientationMaskPortrait)
{
[self.cellBtn setHidden:NO];
[self.leftVC.view setFrame:CGRectMake(0, 64, 300, self.view.current_h-64-49)];
}
if([[UIDevice currentDevice] orientation] == UIInterfaceOrientationLandscapeLeft)
{
[self.cellBtn setHidden:YES];
[self.leftVC.view setFrame:CGRectMake(0, 64, 400, self.view.current_h-64-49)];
}
if([[UIDevice currentDevice] orientation] == UIInterfaceOrientationLandscapeRight)
{
[self.cellBtn setHidden:YES];
[self.leftVC.view setFrame:CGRectMake(0, 64, 400, self.view.current_h-64-49)];
{
[self.cellBtn setHidden:YES];
[self.leftVC.view setFrame:CGRectMake(0, 64, 400, self.view.current_h-64-49)];
}
}
0 0
- iOS---iphone----ipad 横竖屏监听的方法
- JavaScriot 监听(android,ipad.,iphone) 横竖屏切换。
- iphone,ipad横竖屏切换
- iphone/ipad 横竖屏切换
- 判断ipad横竖屏的两个方法
- iPad、iphone 横竖屏的切换事件 两个View切换
- ipad和iphone横竖屏设置
- 设置横竖屏不走生命周期后,监听横竖屏的方法
- 判断ipad横竖屏的方法 ----- 持续改进中 -----
- iOS 横竖屏监听通知
- ios-ipad横竖屏适配
- ios5和ios6横竖屏支持及ipad和iphone设备的判断
- iOS 横竖屏走的方法
- ipad横竖屏尺寸
- ipad横竖屏尺寸
- iphone, ipad, ios的启动图片。
- ios如何取得iphone/ipad的磁盘空间
- iphone, iOS, ipad图标。
- 第17周项目1—小玩文件 (2)
- 在ViewController中添加n个子ViewController
- 使用javap反编译Java字节码文件
- Maven打包带main函数的jar
- 本学期学习心得
- iOS---iphone----ipad 横竖屏监听的方法
- Java学习笔记(8)Multidimensional Arrays
- 第十六周--阅读程序
- db2日志原理
- poi获取excel2003图表以及相关属性
- OpenWrt编译番外篇(一)
- 第十三周项目训练1.3 阅读程序
- 一步一步教你写股票走势图——分时图一(概述)
- NDK开发(手动配置)