Skip to content Skip to sidebar Skip to footer

Can I Override Some Attribute Of Drawable Shape?

I have two buttons, they are same shape, only color is different b1.xml

In your specific case you can try to achieve what you need using the Drawable paint and ColorFilter, something like that:

Buttonb1= (Button) findViewById(R.id.button1);
ShapeDrawablesd= (ShapeDrawable) b1.getBackground();
sb.getPaint().setColor(color);
sb.setColorFilter(... something);

Post a Comment for "Can I Override Some Attribute Of Drawable Shape?"