question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CardView on Android doesn't support flexbox layout

See original GitHub issue

Am I right in thinking this?

I’m trying this and all the text elements appear on top of each other on Android, but on iOS it works as expected:

          <CardView
            style={{ flex: 1, justifyContent: "center", alignItems: "center", height: 100, margin: 20 }}
            cardElevation={2}
            cardMaxElevation={2}
            cornerRadius={0}
          >
            <Text>Elevation 1</Text>
            <Text>Elevation 2</Text>
            <Text>Elevation 3</Text>
            <Text>Elevation 4</Text>
          </CardView>

Having a shadow is nice, but If I can’t layout my card contents in the same way on Android and iOS, the component is not very useful.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Sundincommented, Aug 16, 2017

I’m still having layout problems on Android, the child views are not centered properly using alignItems: “center”. Works as it should on iOS.

0reactions
YouCiicommented, Aug 13, 2018

Is ‘height’ props must required? I think it would be better like View, which ‘height’ is adaptive according to the height of its sub-layouts

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flexbox doesn't support cardview inside? - Stack Overflow
I want to create many cardviews inside flexbox layout. But i it always return NullPointerException. What error console said. android.view.
Read more >
Flexbox-Layout in Android - GeeksforGeeks
The flexWrap attribute controls whether the flex container is single-line or multi-line, and the direction of the cross axis (Perpendicular to ...
Read more >
Android FlexboxLayout Overview - YouTube
check my blog http://myhexaville.comLibrary and samples herehttps://github.com/google/ flexbox - layout.
Read more >
Cards - Material Design
A card has a container and an optional thumbnail, header text, secondary text, media, supporting text, buttons and icons. card anatomy diagram. Container ......
Read more >
Card layout - DevExpress Support
I am looking for Blazor CardView(Cards) component. But to my surprise, Devexpress Blazor suite doesn't have one.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found