how to set colored border on cardview

后端 未结 6 1490
春和景丽
春和景丽 2020-12-05 05:16

I am implementing card view but I can\'t find any border option to set a border on it.

here is my card.xml:



        
6条回答
  •  萌比男神i
    2020-12-05 05:42

    Just use the MaterialCardView with the app:strokeColor and app:strokeWidth attributes.

    Note that without an app:strokeColor, the card will not render a stroked border, regardless of the app:strokeWidth value (the default values are app:strokeColor=@null and app:strokeWidth=0dp).

    Something like:

    
    
        ...
    
    
    

提交回复
热议问题