赞
踩
TextView 添加Selector的背景和颜色不能正常运行,原因,textview未设置clickable
<TextView
android:id="@+id/tv_edit"
android:layout_width="63dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_margin="10dp"
android:background="@drawable/background_donwload_edit"
android:gravity="center"
android:text="@string/edit"
android:textColor="@color/kk_download_edit_color"
android:textSize="12sp"
android:clickable="true"
/>
background_donwload_edit.xml文件
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/kk_download_edit_normal" android:state_pressed="false"></item>
<item android:drawable="@drawable/kk_download_edit_pressed" android:state_pressed="true"></item>
</selector>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。