developer35987456
developer35987456

Reputation: 61

MaterialCardView setStrokeColor not working

<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="cardView"
    android:layout_width="wrap_content"
    android:layout_height="24dp"
    android:clickable="true"
    android:focusable="true"
    android:orientation="horizontal"
    app:cardCornerRadius="8dp"
    app:cardElevation="0dp"
    app:strokeColor="#191919"
    app:strokeWidth="1dp">

and my class I want to set // cardView.strokeColor = Color.parseColor(tags.borderColor)//

I used invalidate() but not working. Also, I am open to new ideas for setting stroke color with other components or etc.

Upvotes: 1

Views: 34

Answers (0)

Related Questions