Hi There, I am facing one issue. I have Text displ...
# compose
m
Hi There, I am facing one issue. I have Text displayed inside LazyColumn. But the content of text is different so for that reason it is displaying in weird manner as shown below, I tried to wrapContentHeight(), heightIn() etc but could not succeed, Can someone help here please ?
z
What does your item layout look like?
m
LazyColumn { Row{ Column{ Text(...) } } }
z
No modifiers?
Why do you have a row and column with only one child?
It looks like there are at least two children in the row based on that screenshot
w
This is a wrong usage with LazyColumn. Where is item or items?\
z
Pro tip: if you ask people to help debug your code, it saves everyone a lot of time if you share the actual code you’re trying to debug and not some abbreviated snippet that obviously doesn’t even compile.
e
https://stackoverflow.com/help/mcve will help get help with any questions, whether it's on Stack Overflow or here or any other forum
m
@Zach Klippenstein (he/him) [MOD] Sir, I know. I can't share the code directly as it will be a violation, so I was giving snippet. I will try to put minimal code later. Thanks
Guys, I have modified the code to paste it here along with the updated screen. As we can see 4 texts and bottom two are taking some space from top
Copy code
LazyColumn(
    modifier =
        Modifier
            .height(500.dp),
) { // fixed height to support nested scroll and preserve recycling
    val section = sections[0]
    val questions = section.questions
    var count = 1

    items(questions!!) {questionsItem ->

        Text(
                text = "$count. ${questionsItem.label ?: ""}"
        )
        count++
    }
}
sorry to bother you guys, got the answer, there are two \n\n initially for these two lines, now wondering how to remove that 😛