Answers for "set button icon color programmatically android studio"

0

kotlin change materialbutton icon color programmatically

val button = findViewById<MaterialButton>(R.id.btnShowDepartmentList)
button.setOnClickListener {
    button.setIconTintResource(R.color.orangeLighter)
}
Posted by: Guest on May-31-2021
0

android studio change button color programmatically

// If you're in an activity:
Button11.setBackgroundColor(getResources().getColor(R.color.red));
// OR, if you're not: 
Button11.setBackgroundColor(Button11.getContext().getResources().getColor(R.color.red));
Posted by: Guest on March-10-2021

Code answers related to "set button icon color programmatically android studio"

Browse Popular Code Answers by Language