2

I have add list in my content view. Bind data in list using below code. Now i want to disable scrolling in some case and enable in some case. How can i achieve this functionality.

Note: No need ForEach solution.

List(0..<self.titles.count) { index in
                        HStack {
                            Image(self.titles[index]).resizable()
                                .frame(width: 60.0, height: 60.0)
                            Text(self.titles[index])
                        }
                    }
Yogendra Patel
  • 813
  • 2
  • 8
  • 24
  • 1
    `.disabled(true)` would disable any interaction, hence the scrolling. If that's no problem - then go for it. – Kai Zheng Jun 30 '20 at 11:53
  • 1
    Does this answer your question? [Disable Scrolling in SwiftUI List/Form](https://stackoverflow.com/questions/60905671/disable-scrolling-in-swiftui-list-form) – donnywals Jun 30 '20 at 12:03

1 Answers1

-5

Will disable scrolling of all subViews in List too, but interaction with pickers etc is active

List {
    // ...
}.moveDisabled(true)