CardView not showing shadow elevation

前端 未结 17 1290
广开言路
广开言路 2020-12-14 16:32

I am working with cardviews but the problem is my CardView is not showing any elevation or shadow. I have already tried some of the methods suggested in stackoverflow answer

17条回答
  •  一向
    一向 (楼主)
    2020-12-14 17:05

    Lot of good answers, but sometimes just one doesn't work for all. here's the one that worked for me after a lot of looking around,

    Add this line to your CardView

    app:cardUseCompatPadding="true"
    

    So your cardview looks like this

      
    

    Hope that works! Happy coding!

提交回复
热议问题