您的位置:首页 > 移动开发 > Android开发

Android中如何取消listview的点击效果

2017-01-11 08:50 489 查看

在xml文件里面有listselecter的属性引用

<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:listSelector="@android:color/transparent">
</ListView>

引用transparent之后会让点击效果透明化,昨天整了半天才搞出来,记录一下。

PS:去除或替换listview 默认的点击选中时的颜色

1.去除默认的点击选中时的颜色

(1)设置列表layout的backgroudcolor属性就OK了。

(2)

Android:focusable="false" android:focusableInTouchMode="false"
android:cacheColorHint="#00000000" android:listSelector="#00000000"

2.替换listview 默认的点击选中时的颜色

设置listivew的listSelector属性就可以了。

您可能感兴趣的文章:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  listview 点击