Skip to content

Instantly share code, notes, and snippets.

@gtokman
Created March 10, 2021 04:44
Show Gist options
  • Save gtokman/84c10dd0c5dc664d2d7b90c58ddf575f to your computer and use it in GitHub Desktop.
Save gtokman/84c10dd0c5dc664d2d7b90c58ddf575f to your computer and use it in GitHub Desktop.
PageTabViewStyle
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