Hi i'm using an TabView with the PageTabViewStyle to give me some kind of horizontally scrollable snapchat interface. My problem is that the TabView doesnt just enable the views to scroll horizontally but also vertically and i would like to prevent that from happening
- wanted behavior (horizontal scrolling)
- unwanted behavior (vertical scrolling)
Here is the code to reproduce the behavior
import SwiftUI
struct test: View {
var body: some View {
TabView {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}.tabViewStyle(PageTabViewStyle())
}
}
struct test_Previews: PreviewProvider {
static var previews: some View {
test()
}
}
I have tried using
.onAppear(perform: {
UIScrollView.appearance().bounces = false
})
one one view
and
.onDisappear(perform: {
UIScrollView.appearance().bounces = true
})
on the others but this does not work as well because the appear/disappear seem to be super buggy
Can't wait to recieve some answers Best Xaver