Android - Listview Background Problem
I have a problem, and i know that the answer properly is pretty simple, but I've tried everything at the moment, and I can't figure out what I'm doing wrong. In my project I've got the following layouts: main.xml
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="3dp">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"/>
<TabWidget
android:id="@android:id/tabs"
android:background="@layout/customtabshape"
android:layout_width="fill_parent"
android:layout_height="80px"
android:layout_alignBottom = "@android:id/tabcontent"
/>
</RelativeLayout>
</TabHost>
nyheder.xml
<?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:layout_marginBottom="80px">
<ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:src="@drawable/tv2sport" android:layout_width="fill_parent"></ImageView>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/feedtitle" />
<TextView
android:layout_width="0px"
android:layout_height="0px"
android:id="@+id/feeddescribtion"/>
<TextView
android:layout_width="0px"
android:开发者_运维技巧layout_height="0px"
android:id="@+id/feedpubdate"/>
<TextView
android:layout_width="0px"
android:layout_height="0px"
android:autoLink="web"
android:id="@+id/feedlink"/>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
row.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/listtitle"
android:textSize="24px"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/listpubdate"
android:textSize="20px"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
rsslist.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rowtext"
android:layout_width="fill_parent"
android:layout_height="25px"
android:textSize="10sp"/>
My problem is, that I want the same background texture everywhere. I can get it anywhere but the list itself.
According to this article http://developer.android.com/resources/articles/listview-backgrounds.html
and multiple others, I should be able to fix my problem with black background in the list, by using android:cacheColorHint="#00000000" inside the list. But I've almost tried putting that line everywhere, and the background in the list is still black. What am I doing wrong? (I know that there is no background at the moment, I did that not to make things more complicated).
You need to just add
android:scrollingCache="false"
in ListView in xml file.
精彩评论