admin管理员组文章数量:1401590
I have started trying to work with Compose Multiplatform and the following looks like a bug, but I'm new so I'll ask here before reporting. The following code produces web view with 1 text and 6 buttons arranged vertically as expected. If I shrink the window so that only a portion of the buttons can be seen, I can scroll the column, but the scroll stops too soon, and the last item never becomes visible. The original code was much more complicated but I edited down to this and still observe the problem.
NOTE: the actual interface here typically fits all on screen, scroll is just to cover corner cases or amazingly small devices, so let's not spend time talking about LazyColumn, thanks.
@Composable
@Preview
fun App() {
MaterialTheme {
val state = rememberScrollState()
Column(Modifier.verticalScroll(state = state)) {
Text(
text = "Foobar",
)
Button(onClick = { /*todo*/ }) {
Text("Log In")
}
Button(onClick = { /*todo*/ }) {
Text("Sign Up")
}
Button(onClick = { /*todo*/ }) {
Text("Check Foo")
}
Button(onClick = { /*todo*/ }) {
Text("Log In")
}
Button(onClick = { /*todo*/ }) {
Text("Sign Up")
}
Button(onClick = { /*todo*/ }) {
Text("Check Foo")
}
}
}
}
The issue can be seen in these three images:
- Initial render
- Scrolling as far down as possible
- Window expanded such that scrolling is not required
I have tried with various numbers and types of items and adding a spacer at the bottom hacks it away, but am I doing something wrong here? Is this a bug in CMP?
I haven't bothered to test this on devices yet since anything that doesn't work on web is a no-go.
Edit: I did eventually test it on iOS and Android, same result
本文标签: compose multiplatformVertical scroll in Column() off by oneStack Overflow
版权声明:本文标题:compose multiplatform - Vertical scroll in Column() off by one - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744265472a2597928.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论