Android:在 listView 单击上禁用突出显示 [英] Android: disabling highlight on listView click

查看:37
本文介绍了Android:在 listView 单击上禁用突出显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用触摸 listView 行时出现的橙色突出显示.到目前为止,在我的 xml 中,我尝试了以下操作:

I want to disable the orange highlight that occurs when touching a listView row. So far in my xml I have tried the following:

android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"

更多信息:当用户在这个 listView 对象上触摸屏幕时,我希望有零差异.

More information: I want there to be zero difference when a user touches the screen on this listView object.

推荐答案

将此添加到您的 xml:

Add this to your xml:

android:listSelector="@android:color/transparent"

对于这个问题,这可能有效(我不确定,也不知道是否有更好的解决方案):

And for the problem this may work (I'm not sure and I don't know if there are better solutions):

您可以将 ColorStateList 应用于您的 TextView.

You could apply a ColorStateList to your TextView.

这篇关于Android:在 listView 单击上禁用突出显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆