-
-
Save stevencurtis/0adb96bdc12bcd7852366bc2a6cc2bcd to your computer and use it in GitHub Desktop.
pagetabviewstylecode
This file contains 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 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