如何自定义 QLPreviewController 的导航栏和工具栏 tintColor

如题所述

自从 iOS5 可以主题控件基于全局或当所包含的特定容器的类的实例。IOS6 自前一种方法的设置 QLPreviewController 设置的 UINavigationBar tintColor 的子类停止了工作。

请考虑以下为例,与 iOS5 和 iOS6 兼容的解决方法之一:

任何包含在 QLPreviewController 内的 UINavigationBar:

[[UINavigationBar appearanceWhenContainedIn:[QLPreviewController class], nil]
setTintColor:[UIColor blackColor]];
或全局设置在您的应用程序与范围内的所有 UINavigationBar 实例的 tintColor:

[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-05-26
自从 iOS5 可以主题控件基于全局或当所包含的特定容器的类的实例。IOS6 自前一种方法的设置 QLPreviewController 设置的 UINavigationBar tintColor 的子类停止了工作。

请考虑以下为例,与 iOS5 和 iOS6 兼容的解决方法之一:

任何包含在 QLPreviewController 内的 UINavigationBar:

[[UINavigationBar appearanceWhenContainedIn:[QLPreviewController class], nil]
setTintColor:[UIColor blackColor]];
或全局设置在您的应用程序与范围内的所有 UINavigationBar 实例的 tintColor:

[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
这同样的战略与 UITabBarController 工作。
相似回答
大家正在搜