Default selector background in Clickable Views

前端 未结 9 1342
执念已碎
执念已碎 2020-12-23 02:15

I have some clickable views and I want to set the default available background that is present on list click (in ICS is a blue color). I have tried putting as background thi

9条回答
  •  爱一瞬间的悲伤
    2020-12-23 02:24

    There is a way to combine all the valid answers:

    Define a attribute (eg. in values/attrs.xml):

    
    

    In your platform dependent theme section (eg. in values/styles.xml or values/themes.xml) declare this:

    
    

    In your platform dependent theme section for api-11+ (eg. in values-v11/styles.xml or values-v11/themes.xml) declare this:

    
    

    Then use ?attr/clickableItemBackground wherever needed.

提交回复
热议问题