Thread
#compose
    a

    AG

    2 years ago
    Hello, can someone help me to figure out how to make
    LazyRowItems
    with
    wrap content
    inside
    LazyColumnItems
    work correctly. In this example I have a row with images where each image has width 100dp. When I’m not passing modifier value with height in
    LazyRowItems
    it shows only one row and Text is not rendering , also it’s possible to scroll the page, but when I’m passing modifier with
    preferredHeight
    all works correctly,
    wrapContentHeight
    not working also.
    LazyColumnItems(items = List(size = 30, init = { it })) { column ->
        if (column % 2 == 0) {
            LazyRowItems(
                items = List(size = 30, init = { it })
                //modifier = Modifier.preferredHeight(100.dp)
            ) { row ->
                Image(
                    asset = imageAsset,
                    modifier = Modifier.wrapContentHeight(100.dp).aspectRatio(1f)
                )
            }
        } else {
            Text(text = "$column")
        }
    }
    Andrey Kulikov

    Andrey Kulikov

    2 years ago
    hey, wrap content behaviour for LazyColumnItems is not yet supported, so yes, your approach with defining a size is the best workaround for now
    a

    AG

    2 years ago
    ok, thanks @Andrey Kulikov 👍