小编kon*_*dev的帖子

ScalingLazyColumn (Jetpack Compose Wear OS) 默认行为中的错误

我使用ScalingLazyColumn ,里面有很长的文本,如下所示:

@Preview(device = Devices.WEAR_OS_SMALL_ROUND, showSystemUi = true)
@Composable
fun Test(modifier: Modifier = Modifier) {
    val scalingLazyState = remember { ScalingLazyListState() }
    val focusRequester = remember { FocusRequester() }

    Scaffold(
        modifier = modifier,
        positionIndicator = { PositionIndicator(scalingLazyListState = scalingLazyState) }
    ) {
        ScalingLazyColumn(
            modifier = Modifier.scrollableColumn(focusRequester, scalingLazyState),
            state = scalingLazyState,
        ) {
            item {
                Text(
                    longText,
                    Modifier
                        .padding(top = 20.dp, start = 16.dp, end = 16.dp, bottom = 48.dp),
                    textAlign = TextAlign.Center,
                )
            }
        }

    }
} …
Run Code Online (Sandbox Code Playgroud)

android-wear-2.0 wear-os android-jetpack android-jetpack-compose android-jetpack-compose-material3

2
推荐指数
1
解决办法
934
查看次数