how to set colored border on cardview

后端 未结 6 1486
春和景丽
春和景丽 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条回答
  •  执笔经年
    2020-12-05 05:44

    I did this a little simpler by making the cardBackgroundColor green and contentPadding 1dp and inside the card having a ConstraintLayout (or other layout) with a white background, like this:

    
    
            
    
        ...
    
    

    This way no extra xml or other superfluous code is needed.

    Result:

提交回复
热议问题