Libathos
Libathos

Reputation: 3362

ListView in tabhost layout isn't rendering correctly

I'm developing an application for Android 2.3.3 later. In an Activity I use a tabhost the first tab has a pager for photos, the second a list, The whole layout has a background image. When I test my app in my virtual Machine API lvl 18 there is no problem, when I test it in my device Android 2.3.6, I have a problem. When I scroll the list, its background becomes white and when I stop interacting with it, its background is returned to be the background of the layout.Is this a problem due to Android version? can I do something to fix it? this is the layout file just in case you se something I miss.

<?xml version="1.0" encoding="utf-8"?><TabHost xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tabHost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/panel_start">

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="5dp">

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:layout_weight="1">


                <RelativeLayout
                    android:id="@+id/tab1"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal" >

                            <android.support.v4.view.ViewPager
                                android:id="@+id/pager"
                                android:layout_width="match_parent"
                                android:layout_height="match_parent" />

                </RelativeLayout>               

                <RelativeLayout android:id="@+id/tab2"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal"
                    android:background="@drawable/panel_start" >

                          <ListView
                                android:id="@+id/videos"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_alignParentLeft="true"
                                android:layout_alignParentTop="true" >
                         </ListView>

                </RelativeLayout>





</FrameLayout> 

    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0"
        android:layout_marginBottom="-4dp"/>

</LinearLayout>

Upvotes: 0

Views: 115

Answers (1)

Pravin
Pravin

Reputation: 1362

try this line for ListView

android:cacheColorHint="@android:color/transparent"

By using this your background stay as you given

Upvotes: 1

Related Questions