How can I get the iOS 7 default blue color programmatically?

后端 未结 15 1278
一整个雨季
一整个雨季 2020-12-22 16:04

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 tin

15条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-22 16:34

    The UIWindow.tintColor method wasn't working for me in iOS8 (it was still black), so I had to do this:

    let b = UIButton.buttonWithType(UIButtonType.System) as UIButton
    var color = b.titleColorForState(.Normal)
    

    This gave the proper blue tint seen in a UIBarButtonItem

提交回复
热议问题