HomeiOS Developmentios - SwiftUI methods to stop scrolling conduct of Checklist if display...

ios – SwiftUI methods to stop scrolling conduct of Checklist if display screen is sufficiently big

[ad_1]

I’ve a Checklist with a number of textual content discipline gadgets and sliders.

For smaller screens, I wish to make it scrollable as a result of the content material cannot match on the display screen. (which is the default conduct).

For bigger screens, I wish to disable the scrolling conduct, as a result of it might probably match on the display screen. Scrolling will make slider a bit exhausting to make use of.

If the Checklist is scrollable, I wish to make the keyboard dismiss mode .onDrag. In any other case I wish to make it .interactive.

How I can try this?

My implementation is solely a regular Checklist, which is beneath a NavigationView

// beneath Navigation View
Checklist {
  Part {
    TextField(..)
    Slider(..)
  }
  Part {
    // Extra Stuff
  }
}
.onAppear {
  // Should be .onDrag if scrollable, and .interactive if not
  UIScrollView.look().keyboardDismissMode = .onDrag
}

I do not like VStack UI as a result of Checklist has good part UI out of field.

I’ve seen this query SwfitUI Checklist Make Scrolling disabled nevertheless it’s not useful.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments