Change default global tint color in swift

前端 未结 1 1573

I\'m developing a little app and I would like to change the default global tint color from blue to orange. I\'ve seen many ways to do it in Objective-C but I can\'t seem to get

1条回答
  •  离开以前
    2021-02-14 13:47

    This answer was last revised for Swift 5.2 and iOS 13.5 SDK.


    You can set the tintColor on your window. Because tint color cascades down to all subviews (unless explicitly overridden), setting it on a window will effectively make it global inside that window.

    Add the following line to your application(_:didFinishLaunchingWithOptions:) or scene(_:willConnectTo:options:) just before making the window key and visible:

    window.tintColor = .systemOrange /* or .orange on iOS < 13 */
    

    You can also set in in the storyboard by changing the Global Tint property:

    0 讨论(0)
提交回复
热议问题