for example I added elevation attr to MaterialCardView
, but it doesn't work. and also customizing with background.xml
doesn't work. why it happens. and what is better to use? between them
- 积分
0 - 话题
0 - 评论
3302 - 注册排名
1737
for example I added elevation attr to MaterialCardView
, but it doesn't work. and also customizing with background.xml
doesn't work. why it happens. and what is better to use? between them
This link has usefull information about difference of card view and material card view . and answer to second question : Using material components require material theme. Make sure to use material theme in your project to be able to customize view.
The biggest difference is the use of a
MaterialShapeDrawable
as background implementing some Material features, such as shaping and elevation overlays for Dark Themes.Also
MaterialCardView
supports checking and dragging.About the elevation use the
app:cardElevation
attribute.About the background check your log.You should have an info message:
"Setting a custom background is not supported."