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 6762865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:24:34+00:00 2026-05-26T14:24:34+00:00

I currently have a tabview with a listview inside. I only have three items

  • 0

I currently have a tabview with a listview inside. I only have three items in the listview and for some reason there is a bunch of white space at top. That is, the first item doesn’t start at the top but rather in the middle. Any ideas? Also, i’m thinking that I am using the wrong layout. anything better than a listview if i only need to display three items? Thanks.

Code:

// Data to put in the ListAdapter
    private String[] sdrPlaylistNames = new String[]{ "More Playlists...","Dubstep", "House"};


    Intent playbackServiceIntentDUB, playbackServiceIntentHOUSE;

    //alert dialog
    AlertDialog.Builder builder;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.playlists_layout);
        //fill the screen with the list adapter
        playlistFillData();

        playbackServiceIntentDUB = new Intent(this, DUBAudioService.class); 
        playbackServiceIntentHOUSE = new Intent(this, HOUSEAudioService.class);     

    }

    public void playlistFillData() {
        //create and set up the Array adapter for the list view
        ArrayAdapter<?> sdrListAdapter = new ArrayAdapter<Object>(this, R.layout.list_item, sdrPlaylistNames);
        setListAdapter(sdrListAdapter);
    }

XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

     <ListView
        android:id="@id/android:list"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/selectP" android:stackFromBottom="false">
    </ListView>

    <TextView
        android:id="@id/android:empty"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="20dp" />

    <TextView
        android:id="@+id/selectP"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:gravity="center"
        android:text="Select A Playlist Above"
        android:textColor="#FF3300"
        android:textSize="22dp"
        android:textStyle="bold" >
    </TextView>

</RelativeLayout>
  • 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-26T14:24:34+00:00Added an answer on May 26, 2026 at 2:24 pm

    Oh I missed your real problem in my previous answer.

    Simply set android:layout_alignParentTop="true" to your list view as

    <ListView
            android:id="@id/android:list"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_above="@+id/selectP" android:stackFromBottom="false">
        </ListView>
    

    Hope this time I am clear..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we
Currently I have the following code for a project that represents some probability trees
I currently have a tabview with 3 tabs. 1 tab loads an ActivityGroup which
I currently have a tabview and in my first tab i have a toast
Currently have a form with a ListView. Users of role A get an image
Currently I have UNION's between 3 different select statements giving me three rows. What
Currently have WebSphere with some EJBs and defined custom user registry based on DB.
I currently have some sql that brings back tags. they should have distinct ids,
I currently have a summary message at the top of my form, inviting my
I currently have an MS Access application that connects to a PostgreSQL database via

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.