Вложенная ленивая колонка в Jetpack ComposeAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Вложенная ленивая колонка в Jetpack Compose

Сообщение Anonymous »

Я хочу использовать ленивый столбец под ленивым столбцом и иметь в нем режим вертикальной прокрутки. При использовании вертикальной прокрутки у меня возникли проблемы. Может ли кто-нибудь помочь мне создать представление вложенной прокрутки?
  • Ленивый столбец под ленивым столбцом
  • Нужно иметь вертикальную прокрутку какой контейнер также содержит другой раздел тела
Проблемы, с которыми я столкнулся при использовании ленивого столбца под ленивым столбцом.[![Error Image][1]][1 ]
@Composable
fun NestedColumn() {

LazyColumn() {

item { }

items(200){
Text(text = "This is Inner Nested")

LazyColumn(){

item { }

items(50) {
Text(text = "This is Inner inner Nested")
}
}

}
}
}```

[1]: https://i.sstatic.net/1lTkD.png

Error Message:

Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed. One of the common reasons is nesting layouts like LazyColumn and Column(Modifier.verticalScroll()). If you want to add a header before the list of items please add a header as a separate item() before the main items() inside the LazyColumn scope. There are could be other reasons for this to happen: your ComposeView was added into a LinearLayout with some weight, you applied Modifier.wrapContentSize(unbounded = true) or wrote a custom layout. Please try to remove the source of infinite constraints in the hierarchy above the scrolling container.


Подробнее здесь: https://stackoverflow.com/questions/771 ... ackcompose
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»