Is there a way to set drawable's Alpha using XML?

后端 未结 9 886
无人及你
无人及你 2020-12-24 05:21

Easy like itself . I wanna make an alpha button , which would have a selected drawable this way:




        
9条回答
  •  一向
    一向 (楼主)
    2020-12-24 05:44

    NOTE: This answer is obsolete. See the answer by kikettas for how to solve OP's problem using the compatibility library. (I would delete this answer, but SO won't let me because OP marked it as the solution.)

    Original answer:

    I don't think there's a way to do that. There is an attribute android:alpha, but it applies to views, not drawables. It's only been available since API level 11.

提交回复
热议问题