Created
March 11, 2024 23:06
-
-
Save takoikatakotako/55cac64100c1c2bb05970ac144e7ab28 to your computer and use it in GitHub Desktop.
SwiftUIでTabViewを使って画面を切り替える
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| TabView { | |
| Text("First Tab") | |
| .tabItem { | |
| Image(systemName: "1.square.fill") | |
| Text("First") | |
| } | |
| Text("Second Tab") | |
| .tabItem { | |
| Image(systemName: "2.square.fill") | |
| Text("Second") | |
| } | |
| Text("Third Tab") | |
| .tabItem { | |
| Image(systemName: "3.square.fill") | |
| Text("Third") | |
| } | |
| } | |
| .font(.headline) | |
| } | |
| } | |
| #Preview { | |
| ContentView() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment