androidandroid-cardviewandroid-jetpack-composeandroid-compose-card

Making three Card on Jetpack Compose, but only two are shown


I try to build three different class cards. But why only two is shown?

Preview

Code:

   Scaffold(....){
    innerPadding ->
            BodyContent(Modifier.padding(innerPadding).fillMaxWidth())
        Card(shape = MaterialTheme.shapes.medium, modifier = Modifier.fillMaxWidth().padding(16.dp)) {
                Text("Card COntent")
            }
            Card(backgroundColor = MaterialTheme.colors.surface, shape = MaterialTheme.shapes.medium,
                    modifier = Modifier.fillMaxWidth()) {
                Text("Card COntent")
            }
            Card(Modifier.fillMaxWidth().padding(16.dp), elevation = 8.dp   ) {
                Text("Card COntent")
            }
    }

Solution

  • It is your screen:

    enter image description here

    The first card is covered by the third card.

    Use something like:

       Column() {
            Card() {..}
            Card() {..}
            Card() {..}
        }
    

    enter image description here