androidx.compose.foundation.lazy
rememberLazyListState
Function · from org.jetbrains.compose.foundation:foundation:1.12.2
No hand-written docs yet.
Creates a LazyListState that is remembered across compositions.
Form 1
@Composable
fun rememberLazyListState(
initialFirstVisibleItemIndex: Int = 0,
initialFirstVisibleItemScrollOffset: Int = 0,
): LazyListState
initialFirstVisibleItemIndex: IntOptional
initialFirstVisibleItemIndex: IntOptionalDefault: 0
the initial value for LazyListState.firstVisibleItemIndex
initialFirstVisibleItemScrollOffset: IntOptional
initialFirstVisibleItemScrollOffset: IntOptionalDefault: 0
the initial value for LazyListState.firstVisibleItemScrollOffset
With prefetchStrategyExperimental
@Composable
fun rememberLazyListState(
initialFirstVisibleItemIndex: Int = 0,
initialFirstVisibleItemScrollOffset: Int = 0,
prefetchStrategy: LazyListPrefetchStrategy = remember { LazyListPrefetchStrategy() },
): LazyListState
prefetchStrategy: LazyListPrefetchStrategyOptional
prefetchStrategy: LazyListPrefetchStrategyOptionalDefault: remember { LazyListPrefetchStrategy() }
the LazyListPrefetchStrategy to use for prefetching content in this list
Same as above: initialFirstVisibleItemIndex, initialFirstVisibleItemScrollOffset.
With cacheWindowSince 1.9Experimental
@Composable
fun rememberLazyListState(
cacheWindow: LazyLayoutCacheWindow,
initialFirstVisibleItemIndex: Int = 0,
initialFirstVisibleItemScrollOffset: Int = 0,
): LazyListState
cacheWindow: LazyLayoutCacheWindowRequired
cacheWindow: LazyLayoutCacheWindowRequiredspecifies the size of the ahead and behind window to be used as per LazyLayoutCacheWindow.
Same as above: initialFirstVisibleItemIndex, initialFirstVisibleItemScrollOffset.
Library docs
Creates a LazyListState that is remembered across compositions.
Changes to the provided initial values will not result in the state being recreated or changed in any way if it has already been created.