Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6757999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:43:19+00:00 2026-05-26T13:43:19+00:00

This one is weird. I have a list view that is a part of

  • 0

This one is weird. I have a list view that is a part of Relative Layout. I have set a background to this Relative Layout and made list view background as transparent.

Now, everything was working great till this morning. I could see the whole screen covered with my custom background even if there is just one row in my list view.

Then, I got update on Verizon Motorola Droid X for 2.3.3 (it was 2.2 before). Once it was updated, I started my app again and now here is what happens.

If my list view has only one row, I see a white area below it and not my custom background.
But if it has say 100 rows and thus covers the whole screen I won’t see that weird white background. My relative layout has width and height set to “fill_parent”.

I have posted my XML at the bottom. Has anyone else faced this problem or I am making some really stupid mistake.

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background = "@drawable/background" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <ListView   android:id = "@+id/listQueue"
                android:layout_width = "fill_parent"
                android:layout_height = "fill_parent"
                android:layout_below = "@id/homeScreenBanner"
                android:background="@android:color/transparent"
                android:divider="@drawable/separator"
                android:scrollingCache="false"/>
</RelativeLayout>

EDIT:

I think I have found the solution to this problem:

Changed the layout_height attribute to wrap_content and it worked like a charm. 🙂

Following the changed line.
android:layout_height = "wrap_content"

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:43:20+00:00Added an answer on May 26, 2026 at 1:43 pm

    I wrote a class that can be used in Android 2.1/2 that will do the right thing in 2.3 using reflection with ListViews:

    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    
    import android.content.Context;
    import android.graphics.drawable.Drawable;
    import android.os.Build;
    import android.util.AttributeSet;
    import android.widget.ListView;
    
    public class TransparentListView extends ListView {
    
        private void makeTransparent() {
            if (Build.VERSION.SDK_INT >= 9) {
                try {
    
                    Method overscrollFooterMethod = 
                        TransparentListView.class.getMethod("setOverscrollFooter", new Class[] {Drawable.class});
                    Method overscrollHeaderMethod = 
                        TransparentListView.class.getMethod("setOverscrollHeader", new Class[] {Drawable.class});
    
    
                    try {
                        overscrollFooterMethod.invoke(this, new Object[] {null});
                        overscrollHeaderMethod.invoke(this, new Object[] {null});
                    } catch (IllegalArgumentException e) {
                        e.printStackTrace();
                    } catch (IllegalAccessException e) {
                        e.printStackTrace();
                    } catch (InvocationTargetException e) {
                        e.printStackTrace();
                    }
                } catch (SecurityException e) {
                    e.printStackTrace();
                } catch (NoSuchMethodException e) {
                    e.printStackTrace();
                }
            }
        }
    
        public TransparentListView(Context context) {
            super(context);
            this.makeTransparent();
        }
    
        public TransparentListView(Context context, AttributeSet attrs) {
            super(context, attrs);
            this.makeTransparent();
        }
    
        public TransparentListView(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);
            this.makeTransparent();
        }
    }
    

    Use it in XML as follows:

    <com.myapp.TransparentListView android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:transcriptMode="alwaysScroll"
        android:layout_weight="1"
        android:dividerHeight="0dip"
        android:divider="#00000000"
        android:cacheColorHint="#00000000"
    />  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This one is weird, I have a page that consists of a html table
I know this one is the weirdest of all weird questions I have asked
Ok, this is a really weird one. I have an MPI program, where each
I have a list of items that are in this format: 05/01 – Some
This is pretty weird. I have my Profiler open and it obviously shows that
Boy, this one is really weird. I expect the following code to print 1990,
Ok, this one is really weird... I can't show code for it exactly cause
This is a weird one, but hopefully someone can give me an idea here.
This is a weird one, and unfortunately I can't test it. At my company
This is a bit of a weird one, and I could well be coding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.