开发者

Android - How do I change background image of a button when its pressed programmatically?

开发者 https://www.devze.com 2023-03-06 17:21 出处:网络
How do I do the following using Java instead of in xml? <selector xmlns:android=\"http://schemas.android.com/apk/res/android\">

How do I do the following using Java instead of in xml?

<selector xmlns:android="http://schemas.android.com/apk/res/android">
&开发者_StackOverflow中文版lt;item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/title_search_alt"/>
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/title_search_alt"/>
</selector>


Answered here: Replace selector images programmatically

0

精彩评论

暂无评论...
验证码 换一张
取 消