0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

TabViewの使い方

Posted at

TabViewの使い方

#swiftアプリ開発の備忘録

ソースコード

import SwiftUI

struct ContentView: View {
    var body: some View {
        TabView {
            Group {
                topPage
                helpPage
            }
            .toolbarBackground(.visible, for: .tabBar)
        }
        
    }
}

// MARK: -UI
struct TopView: View {
    var body: some View {
            Text("トップページです")
                .tabItem {
                    Image(systemName: "book.pages.fill")
                    Text("トップ")
                }
    }
}

struct HelpView: View {
    var body: some View {
        Text("ヘルプページです")
            .tabItem {
                Image(systemName: "questionmark.circle.fill")
                Text("ヘルプ")
            }
    }
}

スクリーンショット 2025-01-23 13.52.58.pngスクリーンショット 2025-01-23 13.54.31.png

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?