简体   繁体   中英

UINavigationBar Large Title Ghosting

When tapping the back button in my UINavigationBar the small title becomes a large title but with a strange ghosting effect during the animation.

Has anyone seen this before and/or know how to correct it?

UINavigationBarGhosting

For future reference, the ghosting will happen when you only set appearance attributes for the normal control state:

UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font : UIFont.barButtonBody()], for: UIControl.State.normal)

To prevent the ghosting, you also need to set it for the highlighted state:

UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.font : UIFont.barButtonBody()], for: UIControl.State.highlighted)

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