开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜