Created
March 10, 2021 04:44
-
-
Save gtokman/84c10dd0c5dc664d2d7b90c58ddf575f to your computer and use it in GitHub Desktop.
PageTabViewStyle
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
struct ContentView: View { | |
let colors: [Color] = [ | |
.red, .green, .blue, .gray | |
] | |
var body: some View { | |
GeometryReader { proxy in | |
TabView { | |
ForEach(colors, id: \.self) { color in | |
color // Your cell content | |
} | |
.frame( | |
width: proxy.size.width, | |
height: proxy.size.height | |
) | |
} | |
.tabViewStyle(PageTabViewStyle()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment