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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:26:54+00:00 2026-05-26T10:26:54+00:00

I am trying to create a UI in Android of this maner Labels: tab1

  • 0

I am trying to create a UI in Android of this maner

Labels: tab1 | tab2 | tab3
==========v===============
Customized        ListView
      ...

But I getting the following mannered UI

Labels: tab1 | tab2 | tab3
==========v===============
       Customized ListView
              ...

i.e. I am not able to utilize the complete width of the screen
the area below labels remain empty.

I want to show the ListView covering the complete width of the screen
How can I achieve this. Please Help

Here is Sample code I am using

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/passesBar" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:paddingLeft="10dip"
android:paddingTop="10dip" android:paddingRight="10dip"
android:paddingBottom="5dip">

<TextView android:id="@+id/passesText" android:text="@string/passes_text"
 android:layout_width="wrap_content" android:layout_height="wrap_content"
 android:textSize = "12dip">
</TextView>


<TabHost android:id="@+id/passesTabHost"
android:layout_toRightOf="@id/passesText"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content">

<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="wrap_content">

<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="wrap_content">
    </TabWidget>
<FrameLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@android:id/tabcontent">
    <ListView android:id="@+id/passesList" android:layout_below="@+id/passesBar"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:footerDividersEnabled="true"
    android:listSelector="@drawable/passes_list_item_custom_selector">
    </ListView>         

</FrameLayout>
</LinearLayout>
</TabHost>

Thank you
Nikhil

  • 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-26T10:26:54+00:00Added an answer on May 26, 2026 at 10:26 am

    In your layout xml try this:

    1. Wrap your Customized tag in a LinearLayout it if isn’t already an LinearLayout itself. Set the android:layout_width=0, android:layout_height=wrap_content, and android:weight=1, and android:gravity=left for the LinearLayout tag.
    2. For your ListView tag also wrap it in a LinearLayout if it isn’t already, and set the android:layout_width=0, android:layout_height=wrap_content, and android:weight=3 to the LinearLayout tag.

    This will essentially make the width of the ListView proportionally 3 times as wide as what ever Customized is. Also, setting the gravity will make your Customized view cling to the left side of the screen.

    Here’s the little gem from the android documentation that tells you about this:

    Tip: To create a proportionate size layout on the screen, create a container view group object with the layout_width and layout_height attributes set to fill_parent; assign the children height or width to 0 (zero); then assign relative weight values to each child, depending on what proportion of the screen each should have.

    I got from here.

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

Sidebar

Related Questions

This is my first android project so please help I am trying to create
I am trying to create an android app that has the following: Theme set
I'm trying to create an Android ListView that will look like Instagram pictures feed
I am trying to create an android project using eclipse IDE,its created successfully but
i'm trying to create a Sliding Menu for my android app. Well, at this
I am trying to create an Android app using Maven as describe in this
I am trying to create ListView and fill it with data , but when
I am trying to create an Android View, but im struggling. So hoping someone
I am trying to create a splitView in Android programmatically. This feature is completely
i've been trying to create a map-related android app, but i realized that the

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.