我想禁用当触摸listView行时出现的橙色高亮。到目前为止,在我的xml我已经尝试了以下:
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
更多信息:我希望当用户在这个listView对象上触摸屏幕时,没有任何差异。
我想禁用当触摸listView行时出现的橙色高亮。到目前为止,在我的xml我已经尝试了以下:
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
更多信息:我希望当用户在这个listView对象上触摸屏幕时,没有任何差异。
当前回答
把这个也添加到你的XMl和listselector..希望它会工作
<ListView
android:cacheColorHint="@android:color/transparent"
android:listSelector="@android:color/transparent"/>
其他回答
你可以从onItemClick中获得pos 和做的事:
listView.setItemChecked(pos, false);
这是我知道的最好的方法
把这个也添加到你的XMl和listselector..希望它会工作
<ListView
android:cacheColorHint="@android:color/transparent"
android:listSelector="@android:color/transparent"/>
你只需要添加: android: cacheColorHint = " @android:颜色/透明”
没有什么能帮助我,只有这个:
transparent_drawable.xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00000000"/>
</shape>
layout.xml:
android:listSelector="@drawable/transparent_drawable"
有一种快速简单的方法: 方法:
private void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
//TODO
((ListView)sender).SelectedItem = null;
}
希望能有所帮助;)