如何以编程方式获得iOS 7默认蓝色? [英] How can I get the iOS 7 default blue color programmatically?

查看:230
本文介绍了如何以编程方式获得iOS 7默认蓝色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中创建自定义元素,并想要匹配新iOS的外观和感觉。 iOS 7向我们介绍了一种非常常见的浅蓝色,几种元素的默认颜色或色调,包括系统按钮,分段控件等。他们使用IB轻松选择颜色,如下所示: p>

>



但是,我还没有找到如何轻松地以编程方式访问颜色。我查看了 UIColor文档 ,并且在类本身中似乎没有任何蓝色系统颜色的访问器。



这里是我的问题:这个颜色有一个简单的访问器吗? [UIColor?] 或类似的东西?

解决方案

使用 self.view.tintColor 从视图控制器或 self.tintColor UIView 子类。


I'm creating custom elements in my app and want to match the look and feel of the new iOS. iOS 7 introduced to us a very common lighter blue color, the default color or tint for several elements, including the system button, segmented control, etc. They've made it easy to select the color using IB, as seen here:

However, I haven't found how to easily access the color programmatically. I checked out the UIColor documentation, and there doesn't seem to be any accessor for the blue system color in the class itself.

Here's my question: does a simple accessor exist for this color? [UIColor ?] or something like it? If not, does someone know the exact RGB values for that color?

解决方案

Use self.view.tintColor from a view controller, or self.tintColor from a UIView subclass.

这篇关于如何以编程方式获得iOS 7默认蓝色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆