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

1.1k views Asked by At

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")
            }
    }
1

There are 1 answers

0
Gabriele Mariotti On BEST ANSWER

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