selector选择器

    xiaoxiao2021-03-25  84

    eclipse下: 阿里矢量图库:    http://www.iconfont.cn/plus/home/index?spm=a313x.7781069.1998910419.2.cgTRFA selector选择器:  第一步:          在res文件根目录下新建一个drawable文件夹             第二步:         在drawable文件夹下新建一个.xml (选中selector效果)        第三步:         在.xml 中定义两个<item>       < item android:state_pressed="true" android:drawable="@drawable/home_true" ></ item >     <item android:state_pressed="false" android:drawable="@drawable/home_false"></item>      每个item分别写上android:state_pressed为true或false,并且写上drawable图片 第四步:     在布局文件中,对想要使用这个selector效果的设置为background即可!!
    转载请注明原文地址: https://ju.6miu.com/read-40603.html

    最新回复(0)