1

单击时,我想摆脱列表项周围可怕的蓝色 HOLO 光晕。

我有:

<ListView
        android:id="@+id/projects_list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:cacheColorHint="#00000000"
        android:choiceMode="singleChoice"
        android:listSelector="@android:color/transparent"
        android:paddingBottom="0dp"
        android:paddingLeft="0dp"
        android:paddingRight="0dp"
        android:scrollbars="none" />

但它仍然看起来像这样: http ://www.roji.be/IMG_0001.png

更新:好的,我的应用程序是:

<style name="AppBaseTheme" parent="android:style/Theme.Light">
<item name="android:actionBarStyle">@style/ActionBar</item>
        <item name="android:windowBackground">@drawable/gradient_bg</item>
        <item name="android:windowContentOverlay">@null</item>
</style>

每个列表项都包装在一个 LinearLayout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res/com.axxes.netinc"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/listitemshadow" //9patch shadow 
    android:orientation="vertical"
    android:paddingTop="8dp" >
4

3 回答 3

2

将列表视图的淡入淡出边缘设置为无。

<ListView
    android:id="@+id/projects_list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:cacheColorHint="#00000000"
    android:choiceMode="singleChoice"
    android:listSelector="@android:color/transparent"
    android:paddingBottom="0dp"
    android:paddingLeft="0dp"
    android:paddingRight="0dp"
    android:scrollbars="none"
    android:fadingEdge="none" />
于 2013-03-21T04:26:24.707 回答
0

To remove blue glow completely:

android:overScrollMode="never" place this attribute inside listview.
To change glow color add this code in application class

int glowDrawableId = getResources().getIdentifier("overscroll_glow", "drawable", "android");
        int edgeDrawableId = getResources().getIdentifier("overscroll_edge", "drawable", "android");
        Drawable androidGlow = ContextCompat.getDrawable(this, glowDrawableId);
        Drawable androidEdge = ContextCompat.getDrawable(this, edgeDrawableId);
        androidGlow.setColorFilter(getResources().getColor(R.color.white_20), PorterDuff.Mode.SRC_IN);
        androidEdge.setColorFilter(getResources().getColor(R.color.white_20), PorterDuff.Mode.SRC_IN);
于 2015-08-21T10:23:31.393 回答
0

只需添加android:overScrollMode="never"您的列表视图。

        <ListView
            android:layout_marginTop="5dp"
            android:id="@+id/listview"
            tools:listitem="@layout/row_item"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:overScrollMode="never">
        </ListView>
于 2020-05-10T18:49:15.803 回答