Protocol¶
TabViewStyle¶
This protocol is used to change the appearance and interaction of a TabView.¶
Declaration¶
protocol TabViewStyle
Overview¶
This protocol does not make its interface public and cannot be customized. The only types available are the ones included in the framework and are platform dependent:
- DefaultTabViewStyle (iOS and macOS)
- PageTabViewStyle (iOS only)
- CarouselTabViewStyle (watchOS only)
To learn more about each style, visit their pages.
Apply a TabViewStyle using tabViewStyle(_:):
struct ContentView: View {
var body: some View {
TabView {
Text("Bananas 🍌🍌")
Text("Apples 🍏🍏")
Text("Peaches 🍑🍑")
}
.foregroundColor(Color.white)
.background(Color.yellow)
.tabViewStyle(PageTabViewStyle())
}
}

Availability¶
iOS 14.0+
macOS 11.0+
tvOS 14.0+
watchOS 7.0+