Content width of TabView in SwiftUI

Viewed 349

I'm trying to add some content insets in TabView with page style. Is it possible to change TabView content width, so it could show a part of next and previous View? I can easily do it with HStack or ScrollView, but I wonder if I can do it with TabView as well, because TabView has many features I need in this case.

figma disign what I have now

My test code looks like this:

var body: some View {
    TabView {
        Group {
            ExcursionView(index: 1, count: 3)
            ExcursionView(index: 2, count: 3)
            ExcursionView(index: 3, count: 3)
        }
        .padding(.horizontal, 20)
    }
    .tabViewStyle(.page)
}
0 Answers
Related