How to change the color of the fading edges in a ListView?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How to change the color of the fading edges in a ListView?

Postby BobaFett » Fri May 22, 2009 12:31 am

I have a ListView with a horizontal LinearLayout above. Both are inside of a vertical LinearLayout, which has a white background.

The ListView has fading edges: the list text at the top and bottom edge of the list area fades into the white background - to indicate that the container can be scrolled.

Is it possible to have these fading edges fade to a different color?

The only way I know is to set "android:cacheColorHint" to the desired color - but then the whole list turns into this color, when scrolling through it!

But I only want to change the color of the fading edges of the ListView.

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#FFFFFF"
        >
   
        <LinearLayout
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="#C7C7C7"
                >
      
                <Button
                [...]
                <TextView
                [...]       
        </LinearLayout>

        <ListView
                android:id="@android:id/list"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:drawSelectorOnTop="false"
                android:divider="@drawable/div_black_fade"
                android:cacheColorHint="#FFFFFF" />

</LinearLayout>
BobaFett
Once Poster
Once Poster
 
Posts: 1
Joined: Thu May 21, 2009 11:59 pm
Location: Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 10 guests