3
1

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.

【SwiftUI】NavigationTitleの新しいDisplayMode

Posted at

はじめに

iOS17からNavigationTitleにinlineLargeという新しいスタイルが加わりました。
他のスタイルとの見た目の違いを比較しながら紹介しようと思います。

見た目の違い

Simulator Screenshot - iPhone 14 Pro - 2023-06-08 at 22.56.11.png Simulator Screenshot - iPhone 14 Pro - 2023-06-08 at 22.55.30.png Simulator Screenshot - iPhone 14 Pro - 2023-06-08 at 22.52.43.png

実装

large

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack {
            List {
                ForEach(0..<50) { index in
                    Text("セル\(index)")
                }
            }
            .navigationTitle("テスト")
            .toolbarTitleDisplayMode(.large)
        }
    }
}

inline

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack {
            List {
                ForEach(0..<50) { index in
                    Text("セル\(index)")
                }
            }
            .navigationTitle("テスト")
            .toolbarTitleDisplayMode(.inline)
        }
    }
}

inlineLarge

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack {
            List {
                ForEach(0..<50) { index in
                    Text("セル\(index)")
                }
            }
            .navigationTitle("テスト")
+           .toolbarTitleDisplayMode(.inlineLarge)
        }
    }
}

ドキュメント

おわり

スクリーンショット 2023-06-06 17.23.08.png
「Appleが一般に開示した情報」に該当してると思うので大丈夫だとは思いますが、
もしアウトだったらコメントで教えて欲しいです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?