Drawable as Background for CardView

后端 未结 11 995
傲寒
傲寒 2020-12-08 02:29

the CardView ( android.support.v7.cardview ) stays white even though I set a backround drawable via android:backround - The documentation gives me the feeling that it should

11条回答
  •  佛祖请我去吃肉
    2020-12-08 02:49

    I know this is an old question, but I have a simple solution - just make the first child of your CardView an ImageView and specify the scale type to fitXY. You can get rid of the extra CardView padding by setting cardElevation and cardMaxElevation to 0dp:

    
    
    
        
    
        <... your layout
    
        .../>
    
    
    
    

提交回复
热议问题