1

Is there a way to set CardView border programmatically, I have a situation in which a hex code comes from API call and I need to draw the border of a cardview using that hex color.

I am not able to figure out, since I don't see any method to directly set the border of a cardView. I can only see the method to set the backgroundColor.

Cœur
  • 37,241
  • 25
  • 195
  • 267
DisplayName
  • 222
  • 1
  • 2
  • 11

1 Answers1

2

You can simply wrap your layout into a FrameLayout with a small padding say, 3dp and the desired border color as background color.

Bertram Gilfoyle
  • 9,899
  • 6
  • 42
  • 67