I'm using Material outlined button in Android Studio (material version is 1.4.0). I wanted to change outline color when button is pressed. so,
binding.activeButton.setOnClickListener{
binding.activeButton.setStrokeColor(Color.parseColor("#FFFFFF"))
}
However, I can't use setStrokeColor
method.
It says "Unresolved reference: setStrokeColor"
I still can use app:strokeColor="@color/white"
in the XML file, but I can't use setStrokeColor
method in an activity file.
What would be the reason ? Is it because of material design version?
CodePudding user response:
Try it:
binding.activeButton.setStrokeColorResource(R.color.back_color_green_btn)