Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i overlap list item on each other in android jetpack compose?

enter image description here

I want to implement this ui. How can i overlap post list item on each other in android jetpack compose?

like image 613
Mohammad Avatar asked Apr 03 '21 12:04

Mohammad


People also ask

What is Mutablestateof in jetpack compose?

If you want to change the state of TextField and also update the UI, you can use a MutableState . Compose observes any reads and writes to the MutableState object and triggers a recomposition to update the UI.

What is LazyColumn in jetpack compose?

A LazyColumn is a vertically scrolling list that only composes and lays out the currently visible items. It's similar to a Recyclerview in the classic Android View system.

What is scaffold in jetpack compose?

Scaffold provides a slot for a floating action button. You can use the floatingActionButton slot and a FloatingActionButton : Scaffold(

How do you make a column scrollable in jetpack compose?

We can make the Column scrollable by using the verticalScroll() modifier.


Video Answer


1 Answers

If you're using a Column or a LazyList to display the items, you can use the verticalArrangement parameters with a negative spacedBy space.

LazyColumn(
    verticalArrangement = Arrangement.spacedBy((-32).dp)
) {
    // Put the items to overlap here
}

spacedBy() doc

like image 186
Quentin Nivelais Avatar answered Sep 20 '22 12:09

Quentin Nivelais