-1

I am trying to use ListView with CardView while my code is working fine and i can see a CardView in ListView but CardView elevation and padding is not working while it is working with RecyclerView. Am i the only one or this is the case with everybody ? What am i doing wrong ? I've tried setting listview divider but elevation doesn't work not matter what attributes i use on ListView or CardView! I've tried the following

CardView elevation not working on Android 5.1.1 & Elevation not working

Community
  • 1
  • 1

2 Answers2

1

Take a look at this question and answer below. You'll get what you need.

you should place your CardView within FrameLayout even i suggest you to use RecyclerView.

Community
  • 1
  • 1
Somesh Kumar
  • 8,088
  • 4
  • 33
  • 49
1

I made a little example of ListView and CardView and tested it with API-19 and API-24. https://github.com/AndroidAppNotes/ListView-and-CardView
ListView-and-CardView