Lebron James
02/23/2022, 9:39 AMKseniia Shumelchyk
02/23/2022, 12:10 PMScalingLazyColumn
scrolling is available out of the box. If I understood correctly the problem you need to add/increase padding for the top, so there is an actual space for scrolling. You can do this with specifying values in contentPadding
, for example:
ScalingLazyColumn(
modifier = Modifier.fillMaxSize(),
contentPadding = PaddingValues(
top = 50.dp,
),
verticalArrangement = Arrangement.Center,
state = scalingLazyListState,
autoCentering = false
) {
...
}
Kseniia Shumelchyk
02/23/2022, 12:14 PMautoCentering = true
(default value)? It already does all heavy lifting for you and ensures that all items properly visible in the viewport for different screen shapes/sizes. So you don’t need to specify any paddings manually.John Nichol
02/23/2022, 7:51 PMLebron James
02/24/2022, 3:41 AMJohn Nichol
02/24/2022, 4:57 AMLebron James
02/24/2022, 8:03 AMLebron James
02/24/2022, 8:12 AMval listState = rememberScalingLazyListState(initialCenterItemIndex = 0)