Change Button Background Drawable In Code Close

[Solved] Change Button Background Drawable In Code Close | Swift - Code Explorer | yomemimo.com
Question : change button background drawable in code

Answered by : ali-9mx9uqmjjmkf

if(v.getBackground().getConstantState().equals(getResources().getDrawable(R.drawable.bg_btn_black_outline).getConstantState())) { v.setBackgroundResource(R.drawable.bg_btn_black); s = ( (TextView) v ).getText().toString(); } else { v.setBackgroundResource(R.drawable.bg_btn_black_outline); }

Source : | Last Update : Fri, 28 Jan 22

Question : change button background drawable in code Close

Answered by : ali-9mx9uqmjjmkf

if(v.getBackground().getConstantState().equals(getResources().getDrawable(R.drawable.bg_btn_black_outline).getConstantState())) { v.setBackgroundResource(R.drawable.bg_btn_black); } else { v.setBackgroundResource(R.drawable.bg_btn_black_outline); }

Source : | Last Update : Fri, 28 Jan 22

Answers related to change button background drawable in code close

Code Explorer Popular Question For Swift