4
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 3 years have passed since last update.

iOS 15 でナビゲーションバー、タブバーなどの色が変わらない場合

Last updated at Posted at 2021-09-28

iOS 15からAppearanceの設定方法が追加された

scrollEdgeAppearance このプロパティに対しても設定を行います。

従来の記述に加えてこういう記述が必要です。

if #available(iOS 15.0, *) {
    let appearance = UINavigationBarAppearance()
    appearance.backgroundColor = .black
    UINavigationBar.appearance().standardAppearance = appearance
    UINavigationBar.appearance().scrollEdgeAppearance = appearance
}
        
if #available(iOS 15.0, *) {
    let appearance = UITabBarAppearance()
    appearance.backgroundColor = .black
    UITabBar.appearance().standardAppearance = appearance
    UITabBar.appearance().scrollEdgeAppearance = appearance
}


4
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
4
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?