SmartToolFactory / SmartToolFactory/Jetpack-Compose-Tutorials
hi!i want ask your question about your reply in stackoverflow.com
Abierto
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Kotlin
- Estrellas
- 3.7k
- Forks
- 420
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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")
}
}
}
}
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, kotlin
- Área
- mobile-dev
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 20/100