Search code examples
androidxmlandroid-layoutxml-drawable

Setting alpha of drawable through xml


Can we set the alpha of drawable for its disable state through XML? For example by using android:state_disable.


Solution

  • actually we cant set alpha for drawable instead you should use this setAlpha(int alpha) Specify an alpha value for the drawable.