androidx.compose.foundation
horizontalScroll
Function · from org.jetbrains.compose.foundation:foundation:1.12.2
No hand-written docs yet.
Modify element to allow to scroll horizontally when width of the content is bigger than max constraints allow.
Form 1
fun Modifier.horizontalScroll(
state: ScrollState,
enabled: Boolean = true,
flingBehavior: FlingBehavior? = null,
reverseScrolling: Boolean = false,
)
state: ScrollStateRequired
state: ScrollStateRequiredstate of the scroll
enabled: BooleanOptional
enabled: BooleanOptionalDefault: true
whether or not scrolling via touch input is enabled
flingBehavior: FlingBehavior?Optional
flingBehavior: FlingBehavior?OptionalDefault: null
logic describing fling behavior when drag has finished with velocity. If null, default from ScrollableDefaults.flingBehavior will be used.
reverseScrolling: BooleanOptional
reverseScrolling: BooleanOptionalDefault: false
reverse the direction of scrolling, when true, 0 ScrollState.value will mean right, when false, 0 ScrollState.value will mean left
With overscrollEffectSince 1.8
fun Modifier.horizontalScroll(
state: ScrollState,
overscrollEffect: OverscrollEffect?,
enabled: Boolean = true,
flingBehavior: FlingBehavior? = null,
reverseScrolling: Boolean = false,
)
overscrollEffect: OverscrollEffect?Required
overscrollEffect: OverscrollEffect?Requiredthe OverscrollEffect that will be used to render overscroll for this modifier. Note that the OverscrollEffect.node will be applied internally as well - you do not need to use Modifier.overscroll separately.
Same as above: state, enabled, flingBehavior, reverseScrolling.
Library docs
Modify element to allow to scroll horizontally when width of the content is bigger than max constraints allow.