IOS7 适配应用高度
来源:互联网 发布:淘宝服务器时间同步 编辑:程序博客网 时间:2024/05/17 10:25
方法1:
在plist中View controller-based status bar appearance NO 添加个这个字段
在appDelegate.m中添加
if(IOS7){ [application setStatusBarStyle:UIStatusBarStyleLightContent]; self.window.clipsToBounds = YES; self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height - 20);}
方法2:
在自定义的navigationController或者主navigation 中使用下面的代码适配ios6和7的导航条图片
if (IOS7) { UIImage * image = [[UIImage imageNamed:@"navg_bg"] resizableImageWithCapInsets:UIEdgeInsetsMake(3, 2, 64, 2) resizingMode:UIImageResizingModeTile]; [[UINavigationBar appearance] setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; }else{ [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"navg_bg"] forBarMetrics:UIBarMetricsDefault];}
如果只有部分view出现错位,则在该位中单独调整位置。
if (IOS7) { self.view.bounds = CGRectMake(0, -64, 320, 568); }
修复这个问题的快速方法就是在方法- (void)viewDidLoad中添加如下一行代码:
self.edgesForExtendedLayout = UIRectEdgeNone;
0 0
- IOS7 适配应用高度
- iOS6 / iOS7 状态栏高度适配
- iOS6 / iOS7 状态栏高度适配
- ios7 UITableViewCell高度自适应
- iOS7 -- iOS7的UI适配问题
- 适配iOS7状态栏高度问题
- IOS7 UITextView高度变换问题
- IOS7 UITextView高度变换问题
- IOS7 label 宽度高度自适应
- iOS7下Cell高度自适应
- ios7之后label高度计算
- iOS7之后计算字符串高度
- ios7屏幕适配
- iOS7 适配问题
- ios7适配收集
- IOS7简单适配
- iOS7适配问题
- iOS7适配问题
- awk使用笔记
- 什么是缘?
- 解决WINDOWS 7中显示摄像头的简易方法
- Mysql select data from one table into a new one
- DOM和SAX比较和选择
- IOS7 适配应用高度
- Ubuntu 编译安装 hadoop 2.2.0
- No Hibernate Session bound to thread
- jquerymobile常用data属性
- 正则表达式
- 关于fastjson序列化部分源码解析
- 微软更新Visual Studio 2013正式版镜像(汇总直接下载地址)
- 反省——离职之后
- java桌面程序读取百度热搜的前10个关键字新闻