SmartToolFactory / SmartToolFactory/Jetpack-Compose-Tutorials
hi!i want ask your question about your reply in stackoverflow.com
未关闭
还没有人认领这个 Issue。
- 主要语言
- Kotlin
- 星标
- 3.7k
- 派生
- 420
- PR 合并指标
- 30 天内没有已合并 PR
描述
how-to-put-a-lazyverticalgrid-inside-a-scrollable-column when item count = 500, maybe have some problems in scroll
@Preview(showBackground = true)
@Composable
private fun Test() {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
) {
Box(modifier = Modifier
.fillMaxWidth()
.height(200.dp)
.background(Color.Red))
Stats(
modifier = Modifier.heightIn(max = 1000.dp),
stats = List(500) { it }
)
Box(modifier = Modifier
.fillMaxWidth()
.height(200.dp)
.background(Color.Yellow))
}
}
@Composable
fun Stats(
modifier: Modifier = Modifier,
stats: List<Int>
) {
LazyVerticalGrid(
modifier = modifier,
columns = GridCells.Fixed(2)
) {
itemsIndexed(stats) { index, item ->
Box(
modifier = Modifier.aspectRatio(1f),
contentAlignment = Alignment.Center
) {
Text("Item $index")
}
}
}
}
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
Start by reviewing the linked Stack Overflow question and the Test and Stats composables in the issue body. Reproduce the example with 500 items and inspect the nested vertical scrolling behavior. Done requires a clearly confirmed scrolling problem, an agreed expected behavior, and a documented resolution.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, kotlin
- 领域
- mobile-dev
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 20/100