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.