scrollBy

Function

Common
suspend fun ScrollableState.scrollBy(value: Float): Float

Jump instantly by value pixels.

Cancels the currently running scroll, if any, and suspends until the cancellation is complete.

Parameters

valuenumber of pixels to scroll by

Returns

the amount of scroll consumed
Common
suspend fun Scrollable2DState.scrollBy(value: Offset): Offset

Jump instantly by value pixels.

Cancels the currently running scroll, if any, and suspends until the cancellation is complete.

Parameters

valuenumber of pixels to scroll by

Returns

the amount of scroll consumed