Created
October 24, 2024 01:09
-
-
Save takoikatakotako/63ed7c883466161f7b1240d917621446 to your computer and use it in GitHub Desktop.
スワイプで遷移するチュートリアル画面を作る
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 { | |
| ContentViewCell(image: Image(.snorlax)) | |
| ContentViewCell(image: Image(.magnemite)) | |
| ContentViewCell(image: Image(.psyduck)) | |
| ContentViewCell(image: Image(.quagsire)) | |
| ContentViewCell(image: Image(.slowpoke)) | |
| } | |
| .frame(maxWidth: .infinity, maxHeight: .infinity) | |
| .background(Color.gray) | |
| .tabViewStyle(.page) | |
| .menuIndicator(.visible) | |
| } | |
| } |
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 ContentViewCell: View { | |
| let image: Image | |
| var body: some View { | |
| image | |
| .resizable() | |
| .scaledToFit() | |
| .frame(width: 240, height: 240) | |
| .background(Color.white) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment