Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created June 23, 2020 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencurtis/0adb96bdc12bcd7852366bc2a6cc2bcd to your computer and use it in GitHub Desktop.
Save stevencurtis/0adb96bdc12bcd7852366bc2a6cc2bcd to your computer and use it in GitHub Desktop.
pagetabviewstylecode
import SwiftUI
struct PageTabViewStyleExampleView: View {
let colors: [Color] = [.red, .green, .orange, .blue]
var body: some View {
TabView {
ForEach(0..<4) { index in
Text("Tab \(index)")
.font(.title)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(colors[index])
.cornerRadius(8)
}
}.tabViewStyle(PageTabViewStyle())
}
}
struct PageTabViewStyleExampleView_Previews: PreviewProvider {
static var previews: some View {
PageTabViewStyleExampleView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment