1.7.2
会带来 QMUI 新旧版本兼容问题的更新
- 配置表开关
HidesBottomBarWhenPushedInitially
的默认值从YES
改为NO
,以保持与系统的默认值一致。 - 配置表
UIColorForBackground
、TableViewBackgroundColor
和TableViewGroupedBackgroundColor
的默认值改为nil
,以减少对项目的侵入性。 - 将 UIViewController (QMUI)
qmui_isTransitioningTypePresented
重命名为qmui_isPresented
,并修复原本的实现错误。 QMUICommonTableViewController
的didInitializedWithStyle:
方法开放到.h 里提供给子类重写。- 删除 QMUICommonViewController
willPopViewController
、didPopViewController
方法,替换为新增的QMUINavigationControllerDelegate
方法:willPopInNavigationControllerWithAnimated:
、didPopInNavigationControllerWithAnimated:
。 - 重构
QMUIStaticTableViewCellData
,增加更多功能的同时提供更便捷的使用方式。
如何适配新版
使用者若从旧版更新到 1.7.2,需要做以下几步适配工作(直接使用新版的请略过这段):
- 如果你的项目中存在
UITabBarController
,并且项目使用了配置表,则请检查 tabBarController 每个界面的 tabBar 显隐是否有问题。 - 如果项目使用了配置表,请检查每个继承自
QMUICommonViewController
的界面的背景色是否正确。 - 把项目里的
qmui_isTransitioningTypePresented
全局搜索替换为qmui_isPresented
。 - 对于
QMUICommonTableViewController
的子类,建议把重写initWithStyle:
方法改为重写didInitializedWithStyle:
,以同时兼容代码使用和 storyboard 使用(非必须)。 - 将项目里重写过的
willPopViewController
、didPopViewController
方法都改为用新的QMUINavigationControllerDelegate
方法:willPopInNavigationControllerWithAnimated:
、didPopInNavigationControllerWithAnimated:
。 - 以新的方式使用
QMUIStaticTableViewCellData
,具体使用方式请查看注释或 QMUI Demo。 - 按照最新的配置表更新项目里的配置表,新增开关包括:
TabBarItemTitleFont
、TableViewCellDetailButtonImage
、TableViewCellSpacingBetweenDetailButtonAndDisclosureIndicator
、AutomaticallyRotateDeviceOrientation
。
其他更新
- 新增
QMUIMarqueeLabel
用于实现跑马灯效果。 - NSString (QMUI) 增加
qmui_stringByConcat:
方法用于拼接字符串。 QMUINavigationControllerDelegate
新增方法preferredNavigationBarHiddenState
用于控制每个界面的导航栏的显隐。QMUINavigationControllerDelegate
新增方法viewControllerKeepingAppearWhenSetViewControllerWithAnimated:
用于捕捉通过setViewControllers:
方式修改界面的堆栈时的界面刷新时机。- 修复
QMUINavigationController
在调用popToViewController:animated:
、popToRootViewControllerAnimated:
、setViewControllers:animated:
这 3 个方法时只会触发第一个被 pop 的 viewController 的 willPop、didPop 方法,其他同样也被 pop 的 viewController 的这两个方法却不会被调用的 bug。 - 重新整理
QMUICommonViewController supportedOrientationMask
属性的功能,保证在支持不同方向的界面之间互相切换时屏幕能正确旋转。 - QMUIHelper (Orientation) 增加方法
rotateToDeviceOrientation:
用于主动改变屏幕方向。 - 让 QMUI 也支持 iOS 8 控制状态栏的那些接口,至于用系统接口还是用
QMUIHelper
就看 Info.plist 里View controller-based status bar appearance
的值被设置为什么。 - UIImage (QMUI) 增加
QMUIImageShapeDetailButtonImage
形状用于生成一个列表右边的 i 详情按钮图片 - 为 UIViewController、UINavigationController、UITabBarController、QMUICommonTableViewController 增加详细的 description。
- 配置表增加
TabBarItemTitleFont
用于修改 UITabBarItem 的文字字体。 - 配置表增加
TableViewCellDetailButtonImage
和TableViewCellSpacingBetweenDetailButtonAndDisclosureIndicator
属性用于设置 QMUITableViewCell 右边显示的 i 按钮图片。 - 配置表增加开关
AutomaticallyRotateDeviceOrientation
用于控制是否要自动在界面切换时根据界面支持的方向的不同而主动旋转。