Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 38

Hamza choudhary
Aspiring developer
Profile
Posts: 35
Reg: Dec 03, 2013
India,mumbai
350
02/21/14 09:56 AM (10 years ago)

Listview goes black when scrolled !

Hii all, I am working on an android app and using menu with image plugin, in the previous version of Buzztouch only one item in the listview was going black when scrolled but now in v 3.0, all the items goes black. I want my listview to be transparent. so is there any way to solve the prob. thanks, Hamza
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/21/14 10:07 AM (10 years ago)
There's a setting that needs to be added to the XML file. On my phone atm, and don't remember the details. But a quick Google search should give you the answer.
 
Hamza choudhary
Aspiring developer
Profile
Posts: 35
Reg: Dec 03, 2013
India,mumbai
350
like
02/21/14 01:00 PM (10 years ago)
thanks for the reply Cris. I serched on google and got the same answer on most of the sites.They told to add this line of code to the listview .xml (android:cacheColorHint="@android:color/transparent"). But this code is already there in bt_screen_menusimple.xml of my project ,then to it goes black when scrolled. Thanks again, Hamza
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/21/14 01:21 PM (10 years ago)
Okay, I'm back at my computer now. Here's the XML file that I modded for a project a couple weeks ago to fix this problem: ----------------wb_screen_menuimage.xml----------------- <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerView" android:background="@android:color/transparent" android:padding="0dip" android:layout_margin="0dip" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:id="@+id/headerImageContainer" android:background="@android:color/transparent" android:padding="0dip" android:layout_margin="0dip" android:layout_centerHorizontal="true" android:layout_alignParentTop="true" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/headerImageView" android:layout_width="fill_parent" android:layout_height="150dip" android:scaleType="fitXY"> </ImageView> </LinearLayout> <LinearLayout android:id="@+id/listViewContainer" android:background="@android:color/transparent" android:padding="0dip" android:layout_margin="0dip" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/headerImageContainer"> <View android:id="@+id/listViewStart" android:background="#00ff00" android:layout_width="fill_parent" android:layout_height="1dp" android:layout_alignParentLeft="true" android:layout_alignParentRight="true"> </View> <ListView android:id="@+id/listView" android:background="@android:color/transparent" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scrollingCache="false" android:cacheColorHint="#00000000" android:choiceMode="singleChoice" android:scrollbars="none"> </ListView> <View android:id="@+id/listViewEnd" android:background="#00ff00" android:layout_width="fill_parent" android:layout_height="1dp" android:layout_alignParentLeft="true" android:layout_alignParentRight="true"> </View> </LinearLayout> </RelativeLayout>
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/21/14 01:22 PM (10 years ago)
I think the key pieces were: android:scrollingCache="false" android:cacheColorHint="#00000000"
 
Hamza choudhary
Aspiring developer
Profile
Posts: 35
Reg: Dec 03, 2013
India,mumbai
350
like
02/22/14 12:18 AM (10 years ago)
Awesome , problem solved. thanks a lot Chris.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.