0

My layout contains a single ScrollingLazyColumn that fills the entire screen. The first item should be at the top of the screen, but it is centered.

Here is my code:

@Preview(device = Devices.WEAR_OS_SMALL_ROUND, showBackground = true, backgroundColor = 0xff000000)
@Composable
private fun PreviewTest() {
    Scaffold() {
        ScalingLazyColumn(
            modifier = Modifier.fillMaxSize(),
            verticalArrangement = Arrangement.Top
        ) {
            item {
                Text("this should be at the top")
            }
        }
    }
}

As you can see, I've already usedverticalArrangement, but it does absolutely nothing (Bottom doesn't work either).

The same code will work perfectly fine if I switch out ScalingLazyColumn for a regular LazyColumn.

Is there a bug in the code?

EDIT: I just realized that ScalingLazyColumn is marked with @OptIn(ExperimentalWearFoundationApi::class)...

Can I file a bug report somewhere?

CiriousJoker
  • 552
  • 1
  • 7
  • 18

1 Answers1

0

After 2 hours of trying and a minute after posting to StackOverflow, I already have one downvote without explanation, but I also found the solution myself.

I just needed to use this to prevent moving down elements automatically:

autoCentering = AutoCenteringParams(
  itemIndex = 2
)
CiriousJoker
  • 552
  • 1
  • 7
  • 18