SmartToolFactory / SmartToolFactory/Jetpack-Compose-Tutorials
hi!i want ask your question about your reply in stackoverflow.com
Ouverte
Personne n'a encore pris cette issue.
- Langage dominant
- Kotlin
- Étoiles
- 3.7k
- Forks
- 420
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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")
}
}
}
}
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- android, kotlin
- Domaine
- mobile-dev
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 20/100