0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[iOS][Swift] UIBarButtonItem.appearanceで色やフォントがすぐに反映されない場合

Last updated at Posted at 2019-03-08

変更前にnilを設定してから、再度、設定すると反映されます。


            UIBarButtonItem.appearance().setTitleTextAttributes(nil, for: .normal)
            UIBarButtonItem.appearance().setTitleTextAttributes(nil, for: .highlighted)

            let attributes = [NSAttributedString.Key.font:  UIFont(name: "Helvetica-Bold", size: 0.1)!, NSAttributedString.Key.foregroundColor: UIColor.clear]
            UIBarButtonItem.appearance().setTitleTextAttributes(attributes, for: .normal)
            UIBarButtonItem.appearance().setTitleTextAttributes(attributes, for: .highlighted)

参考

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?