in Education by
I'm trying to show a LazyGrid of items within a main screen that has a scrollable content. I tried to set up the screen as follows: @Composable fun MainScreen(){ ConstraintLayout(Modifier.verticalScroll(remeberScrollState())) { val (view, rowView, image, gridView) = createRefs() Row(){ //view } Row (){ //rowView (a lazy row) } Row() { //image } Row() { //gridView } } } Compose had no issue with the other views but once I included the grid view, I had this error: java.lang.IllegalStateException: 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. The LazyVerticalGrid is set up like so: list : List LazyVerticalGrid( cells = GridCells.Fixed(2), content = { items(list.size) { index -> Card(){...} } }) Is there a way to nest a LazyVerticalGrid within any layout that is vertically scrollable? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
simple example: ConstraintLayout(Modifier.verticalScroll(rememberScrollState())){ LazyVerticalGrid( cells = GridCells.Fixed(2),Modifier.height(150.dp)){ items(5){ Text(text = "hello") } } } When a list is nested, the internal list needs to be fixed in height

Related questions

0 votes
    I tried to set the adListener for Interstitial Ad but it doesn't work (AdMob + Kotlin - Mobile ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I'm currently working on a lottery app and have coded the UI for it. The problem is that my page ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    Can you nest UpdatePanel within each other?...
asked Dec 31, 2020 in Technology by JackTerrance
0 votes
    Can we nest comments in a C code?...
asked Nov 9, 2020 in Technology by JackTerrance
0 votes
    I'm trying to figure out how can I create a vertical gap between two elements that are located in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    __________ is interval represented by a vertical line, with a point in the middle. (a) geom_range (b) ... of R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    I'm reading data from a csv file in help of gnuplot. Most of the lines have 8 columns, some of ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    How can you draw straight horizontal and vertical lines with the help of the line tool ? Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    The simultaneous applications of signals x (t) and y (t) to the horizontal and vertical plates respectively, of an ... GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 17, 2021 in Education by JackTerrance
0 votes
    Vertical scaling is called __________. (1)Scaling out (2)Scaling up...
asked Apr 21, 2021 in Technology by JackTerrance
+1 vote
    Vertical scaling is called __________....
asked Oct 11, 2020 in Education by anonymous
0 votes
    I've worked a lot with Pentaho PDI so some obvious things jump out at me. I'll call Connection ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    Now that links are deprecated in docker-compose.yml (and were able to use the new networking feature to ... docker-compose.yml? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have a dump.sql file that I would like to load with docker-compose. docker-compose.yml: services: postgres: ... how to do this? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
...