🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

scrollByOffset

Action to scroll by a specified amount and return how much of the offset was actually consumed.

scrollByOffset

Source set: Common
public fun SemanticsPropertyReceiver.scrollByOffset(
    action: suspend (offset: Offset) -> Offset
): Unit

Action to scroll by a specified amount and return how much of the offset was actually consumed. E.g. if the node can't scroll at all in the given direction, Offset.Zero should be returned. The action should not return until the scroll operation has finished.

Expected to be used in conjunction with verticalScrollAxisRange/horizontalScrollAxisRange.

Unlike scrollBy, this action is synchronous, and returns the amount of scroll consumed.

Parameters

action Action to be performed when SemanticsActions.ScrollByOffset is called.