简体   繁体   中英

Bar button item tint colors with iOS bold text settings

I've received a screenshot from my app by an older lady who seems to have activated "Bold text" in her iPhone settings.

Since I've never really looked at that before and my app does not support dynamic text (which seems to not be related) I was surprised to see that in this mode the tint colors I gave my bar button items are being ignored and they'll always show in standard iOS Nav bar button blue, this line of code does not have an effect anymore:

myBarButtonItem.tintColor = myColor

In my case the color indicates their state so that's a dealbreaker. I know that I could detect whether the user has activated this setting (as indicated in the answer here Possible to detect Bold Text setting in Settings > Accessibility? ) and indicate the state by using different icons...

But is there any way around this and keep my tint colors in bold text mode?

Try with appearance

UIBarButtonItem.appearance().tintColor = yourcolor

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM