'iOS14 SwiftUI How to Disable Scroll on TabView

TabView(selection: $vm.selectedTab) {
   PlanCard_PositiveDay(vm: vm).tag(0)
   PlanCard_CountdownDay().tag(1)
   PlanCard_Basalkcal().tag(2)
   PlanCard_ActivityDiet().tag(3)
   PlanCard_Schedule().tag(4)
   PlanCard_WeightTarget().tag(5)
}
.tabViewStyle(PageTabViewStyle.init(indexDisplayMode: .never))

I use TabView with PageTabViewStyle to build a pageView, but I want to click some button to change position, not auto-scroll to change position with finger gesture, so I want to disable auto-scroll, How can I update my code To achieve this

Thx!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source