ListView looses background while scrolling

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

ListView looses background while scrolling

Postby darolla » Sun Nov 16, 2008 12:03 pm

Hi,

I've got a little bug.

I use a LinearLayout with a ListView, and the ListView has a background.

If I drag the mouse and scroll through the list, the background disappears.

So I trid to put the background to the Linear Layout, same behaviour :(

Are there any flags to avoid this?

I'd like to show the background all the time :)

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.         android:orientation="vertical" android:layout_width="fill_parent"
  7.  
  8.         android:layout_height="fill_parent" android:background="@drawable/bg">
  9.  
  10.  
  11.  
  12.         <ListView android:id="@+id/android:list" android:layout_width="fill_parent"
  13.  
  14.                 android:layout_height="wrap_content" />
  15.  
  16.  
  17.  
  18. </LinearLayout>
  19.  
  20.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Greetings,
DaRolla
Attachments
normal.png
this it should be
normal.png (19.88 KiB) Viewed 269 times
scrolling.png
while scrolling the bg disappears
scrolling.png (18.92 KiB) Viewed 269 times
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Top

Postby darolla » Mon Jan 12, 2009 9:30 am

thanks to Emmanuel7 and his blog at http://androidblogger.blogspot.com and http://androidblogger.blogspot.com/2008 ... tview.html I've found the solution:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. android:cacheColorHint="#00000000"
  3.  
  4.  
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


more infos on that: http://www.curious-creature.org/2008/12 ... imization/

greetings,
darolla
Last edited by darolla on Tue Jan 13, 2009 6:00 pm, edited 1 time in total.
User avatar
darolla
Master Developer
Master Developer
 
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany

Postby MrSnowflake » Mon Jan 12, 2009 12:05 pm

Can't you set the colorhint to the background color of the activity, so the redrawing will go faster, because it shouldn't take data from the framebuffer?
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby Emmanuel7 » Tue Jan 13, 2009 5:12 pm

You sure want to do that, but if your background is an image and not a simple color, it does not work anymore.

So you have to use this colorhint reset !
Emmanuel7
Senior Developer
Senior Developer
 
Posts: 164
Joined: Fri Dec 12, 2008 2:17 am
Location: Paris

Postby MrSnowflake » Tue Jan 13, 2009 5:26 pm

Yeah true, I forgot that he uses a background image and not a fill color, so scratch my previous reply.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests