ScrollView
public struct ScrollView : View
extension ScrollView: Renderable
Creates a view that can scroll its subviews. Unlike a List
,
all subviews are created together with this view.
-
Declaration
Swift
public var viewStore: ViewValues
-
Declaration
Swift
public var body: View { get }
-
Declaration
Swift
public init(_ axis: Axis = .vertical, showsIndicators: Bool = true, @ViewBuilder content: () -> View)
-
Listen to changes in the ScrollView’s content offset. Setting the value of this binding does not affect the ScrollView’s content offset.
Warning
Updates to the value of this binding triggers high performance rendering when updating views. High performance updates don’t update children views of ScrollView and List. See High Performance in the documentation for more information.
Important
Not SwiftUI compatible.
Note
Also see:
View.ignoreHighPerformance
andView.skipHighPerformanceUpdate
.Declaration
Swift
public func contentOffset(_ offset: Binding<CGPoint>) -> ScrollView
-
Applies the specified offset to the ScrollView’s content. Once applied, the value inside the Binding will be set to
nil
.Important
Not SwiftUI compatible.
Declaration
Swift
public func appliedVisibleRect(_ rect: Binding<CGRect?>) -> ScrollView
Parameters
offset
The visible rect to apply
-
Determines if the scroll view can bounce.
Important
Not SwiftUI compatible.Declaration
Swift
public func bounces(_ bounces: Bool) -> ScrollView
-
Updates this view during a high performance update.
See
High Performance Updates
in the documentation for more information.Important
Not SwiftUI compatible.Declaration
Swift
public func ignoreHighPerformance() -> ScrollView
-
Sets if scrolling in this view is enabled or not.
Important
Not SwiftUI compatible.Declaration
Swift
public func scrollEnabled(_ enabled: Bool) -> ScrollView
-
Sets if scrolling is enabled, while still capturing user gestures. Use this instead of
scrollEnabled
if you want to start/stop receiving updates from user gestures while it’s being executed.Important
Not SwiftUI compatible.Declaration
Swift
public func interactiveScrollEnabled(_ enabled: Bool) -> ScrollView
-
Sets the keyboard dismiss mode of the ScrollView. If not set, by default it will be
interactive
.Important
Not SwiftUI compatible.Declaration
Swift
public func keyboardDismissMode(_ dismissMode: UIScrollView.KeyboardDismissMode) -> ScrollView
-
Declaration
Swift
public func createView(context: Context) -> UIView
-
Declaration
Swift
public func updateView(_ view: UIView, context: Context)