Android中Selector的用法(改变ListView和Button的默认背景)

分享到:

Android中的Selector的用法

http://blog.csdn.net/shakespeare001/article/details/7788400#comments

 

Android中的Selector主要是用来改变ListView和Button控件的默认背景

 one template:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
     <item android:state_pressed="true"
           android:drawable="@drawable/ic_mymenu_pressed" /> <!-- pressed -->
     <item android:state_focused="true"
           android:drawable="@drawable/ic_mymenu_pressed" /> <!-- focused -->
     <item android:drawable="@drawable/ic_mymenu" /> <!-- default -->  
</selector>
昵    称:
验证码:

相关文档: