IOS开发 ios7适配
2013-10-18 15:36
316 查看
ios7控制器试图默认为全屏显示,导航栏的不同设置会产生不同的效果.
首先判断系统的的版本,区别:
导航栏的属性:tintColor用于设置控件颜色
导航栏的背景图片不同的size会显示不同的效果.
导航栏中设置空间的image对象都需要进行渲染设置,默认是渲染为末模板,需要渲染为原图才能显示.
bar的样式 barStyle
bar的透明度 translucent
bar的颜色 barTintColor
bar上控件的颜色 tintColor
bar的背景图片 backgroundImage
字体:
Bars 和 Bar Buttons
status bar 默认是透明的,其他 bar 都是半透明的,一个通用原则:确保内容填充 Bar 下面的区域。
navigationBar 在
通过设置控制器的edgesForExtendedLayout 为uirectedgesnone也可以将控制器视图从导航栏下显示,这个属性是iOS7新增的;
UITableView
Grouped table 没有边距了,TableView 上的图标(如:Checkmark,Disclosure indicator,Delete button 等)都变了。
转载请注明出处!!!
首先判断系统的的版本,区别:
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) 官方推荐的版本判断
NSUInteger DeviceSystemMajorVersion(); NSUInteger DeviceSystemMajorVersion() { static NSUInteger _deviceSystemMajorVersion = -1; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ _deviceSystemMajorVersion = [[[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."] objectAtIndex:0] intValue]; }); return _deviceSystemMajorVersion; } #define MY_MACRO_NAME (DeviceSystemMajorVersion() < 7)
导航栏的颜色设置新增属性为barTintColor 具体写法:
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) { self.navigationController.navigationBar.tintColor = [UIColor brownColor]; } else { self.navigationController.navigationBar.barTintColor = [UIColor brownColor]; }
导航栏的属性:tintColor用于设置控件颜色
导航栏的背景图片不同的size会显示不同的效果.
导航栏中设置空间的image对象都需要进行渲染设置,默认是渲染为末模板,需要渲染为原图才能显示.
bar的样式 barStyle
bar的透明度 translucent
bar的颜色 barTintColor
bar上控件的颜色 tintColor
bar的背景图片 backgroundImage
字体:
通过 UIFont 中的 [code]preferredFontForTextStyle属性回去当前系统的字体,确保内容在不同字体下都能很好显示。[/code]
Bars 和 Bar Buttons
status bar 默认是透明的,其他 bar 都是半透明的,一个通用原则:确保内容填充 Bar 下面的区域。
navigationBar 在
UIBarPositionTopAttached模式下会与 status bar 融合的,所以如果使用图片需要用 128px((20 + 44) x 2)。
通过设置控制器的edgesForExtendedLayout 为uirectedgesnone也可以将控制器视图从导航栏下显示,这个属性是iOS7新增的;
UITableView
Grouped table 没有边距了,TableView 上的图标(如:Checkmark,Disclosure indicator,Delete button 等)都变了。
转载请注明出处!!!
相关文章推荐
- IOS越狱开发起步教程
- IOS开发网站汇总
- iOS程序开发引用的第三方库之间出现duplicate symbol时的处理方法
- iOS开发之ARC&MRC混用
- iOS开发中地图(MapKit)的使用
- iPhone/iOS开发推送C++服务端APNS源代码
- 手把手教你ARC——iOS/Mac开发ARC入门和使用
- iOS开发利用zbar实现二维码扫描(支持64位) 及二维码生成
- 手把手教你ARC——iOS/Mac开发ARC入门和使用
- iOS开发之Touch ID指纹验证
- iOS开发--常用技巧 (MJRefresh详解)
- IOS开发-UI学习-使用UIImageView控件制作动画
- iOS开发系列--Objective-C之类和对象
- ios蓝牙开发(二)ios连接外设的代码实现
- iOS开发小方法:根据UIColor一个颜色生成一张图片
- iOS开发-数据库-sqlite操作1
- ios app开发的5点经验教程
- assert NSAssert - iOS开发
- ios开发-利用Xcode分析crashlog,并将其字符串化
- IOS开发UI篇--使用UICollectionView实现一个无限轮播的案例