Can I detect iOS' “darken colors” setting?

后端 未结 1 1898
广开言路
广开言路 2021-01-07 07:03

I noticed that my app doesn\'t look good when the \"darken colors\" iOS system setting is enabled. Some navigation buttons are white, some are darkened to gray.

Is t

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-07 07:12

    Turns out it's quite easy to detect. Suppose the navigationBar is configured with a white tintColor. Just reading navigationBar.tintColor returns the adjusted color, in this case 80% white. We can use this color to set the navigationBar.titleTextAttributes.

    For all tintable elements such as UIBarButtonItems, make sure to use template images only:

    -[UIImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]
    

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