How to add colored border on cardview?

前端 未结 7 1686
遥遥无期
遥遥无期 2020-12-13 05:56

I am new to Android and this is my first question here.

I am trying to add a colored vertical border at the beginning of the cardview. How can I achieve it on xml ?

7条回答
  •  执念已碎
    2020-12-13 06:30

    Start From the material design update, it support app:strokeColor and also app:strokeWidth. see more

    to use material design update. add following code to build.gradle(:app)

    dependencies {
        // ...
        implementation 'com.google.android.material:material:1.0.0'
        // ...
      }
    

    and Change CardView to MaterialCardView

提交回复
热议问题