Default selector background in Clickable Views

前端 未结 9 1329
执念已碎
执念已碎 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:28

    Setting Background restricts you from choosing a background color or drawable later! So my advice is to add this style to your styles.xml:

    
    

    And then on every view you only need to add:

                android:theme="@style/TouchableView"
    

    Like ANY VIEW!

        
    

    Don't forget to add onClickListener to see the results.

提交回复
热议问题