2
3

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 1 year has passed since last update.

【Swift】タイトルのフォントと文字サイズと文字色を同時指定する方法

Last updated at Posted at 2021-11-27

SwiftでNavigationBarのタイトルのフォントと文字サイズと文字色を同時指定する方法。

同時指定する方法を解説している記事がなかったのでメモとして残しておきます。

実装コード

self.title = "タイトル"
self.navigationController?.navigationBar.titleTextAttributes = [
    NSAttributedString.Key.font:  UIFont.systemFont(ofSize: 40),
    .foregroundColor: UIColor.white
]

参考

Swiftのお役立ち情報

2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?