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

后端 未结 9 916
无人及你
无人及你 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:30

    i think you could create your own drawable which could take this argument as a parameter. i've never done such a thing though.

    check out this link :

    How to set alpha value for drawable in a StateListDrawable?

    if that's not possible, you can always do it in code...

    here are 2 links i've found about it, in case you wish to use bitmaps instead:

    • https://plus.google.com/+RomanNurik/posts/FZQcNW8G75K
    • https://gist.github.com/romannurik/5779875

提交回复
热议问题