swiftui-tabview

SwiftUI TabView PageTabViewStyle prevent changing tab?

南笙酒味 提交于 2021-01-20 09:13:39
问题 I have a TabView in SwiftUI in the PageViewTabStyle so i can swipe from page to page. I'd like to have a setting that "locks" the current view in place, so the user cannot swipe. Googling and reading docs isn't turning up anything obvious for me, so I was hoping the gurus on SO could help me out. In short, my code looks like TabView { ForEach(0..<5) { idx in Text("Cell: \(idx)") } } .tabViewStyle(PageTabViewStyle()) I have found the disabled property, but then it appears that all tap events

SwiftUI TabView PageTabViewStyle prevent changing tab?

天大地大妈咪最大 提交于 2021-01-20 09:13:07
问题 I have a TabView in SwiftUI in the PageViewTabStyle so i can swipe from page to page. I'd like to have a setting that "locks" the current view in place, so the user cannot swipe. Googling and reading docs isn't turning up anything obvious for me, so I was hoping the gurus on SO could help me out. In short, my code looks like TabView { ForEach(0..<5) { idx in Text("Cell: \(idx)") } } .tabViewStyle(PageTabViewStyle()) I have found the disabled property, but then it appears that all tap events