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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:05:41+00:00 2026-05-22T23:05:41+00:00

I am trying to make my layout a bit more uniform. I have a

  • 0

I am trying to make my layout a bit more uniform. I have a linear layout that looks like this:

<?xml version="1.0" encoding="utf-8"?>  
<LinearLayout android:id="@+id/LinearLayout01"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

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

            <TextView 
                android:id="@+id/lblQuote" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"/>
        </LinearLayout>

        <LinearLayout 
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1">
           <TextView 
                android:id="@+id/lblLikes" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"
                android:text="27"/>
           <ImageView
                android:id="@+id/imgUp"
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/thumbsup"/>
           <TextView 
                android:id="@+id/lblBuzzedTitle" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"
                android:text="Buzz Level:"/>
            <TextView 
                android:id="@+id/lblShared" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"/>
            <TextView 
                android:id="@+id/lblSaid" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"/> 
        </LinearLayout>
        <LinearLayout 
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1">
          <TextView 
                android:id="@+id/lblHates" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"
                android:text="14"/>
            <ImageView
                android:id="@+id/imgDown"
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/thumbsdn"/>
           <TextView 
                android:id="@+id/lblBuzzed" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"/>
            <TextView 
                android:id="@+id/lblDate" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"/>
            <TextView 
                android:id="@+id/lblLocation" 
                android:layout_width="fill_parent" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"/> 
        </LinearLayout>
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1">
          <TextView
            android:text=" "
            android:textSize="1pt"
            android:background="#6F7285"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>  

        </LinearLayout>
</LinearLayout>

So I’ve switched to this:

    <?xml version="1.0" encoding="utf-8"?>  
<LinearLayout android:id="@+id/LinearLayout01"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

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

            <TextView 
                android:id="@+id/lblQuote" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:layout_weight="1"/>
        </LinearLayout>

        <LinearLayout 
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:weightSum="8">
           <TextView 
                android:id="@+id/lblLikes" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="1"
                android:textSize="4pt"
                android:text="27"/>
           <ImageView
                android:id="@+id/imgUp"
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="1"
                android:src="@drawable/thumbsup"/>
           <TextView 
                android:id="@+id/lblBuzzedTitle" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="2"
                android:textSize="4pt"
                android:text="Buzz Level:"/>
            <TextView 
                android:id="@+id/lblShared" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="2"
                android:textSize="4pt"/>
            <TextView 
                android:id="@+id/lblSaid" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="2"
                android:textSize="4pt"/> 
        </LinearLayout>
        <LinearLayout 
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:weightSum="8">
          <TextView 
                android:id="@+id/lblHates" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="1"
                android:textSize="4pt"
                android:text="14"/>
            <ImageView
                android:id="@+id/imgDown"
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="1"
                android:src="@drawable/thumbsdn"/>
           <TextView 
                android:id="@+id/lblBuzzed" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="2"
                android:textSize="4pt"/>
            <TextView 
                android:id="@+id/lblDate" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="2"
                android:textSize="4pt"/>
            <TextView 
                android:id="@+id/lblLocation" 
                android:layout_width="0dp" 
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:layout_weight="2"
                android:textSize="4pt"/> 
        </LinearLayout>
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:weightSum="1">
          <TextView
            android:text=" "
            android:textSize="1pt"
            android:background="#6F7285"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>  

        </LinearLayout>
</LinearLayout>

Upon doing that my layout goes blank in the emulator. Please advise. I do not want to switch to Relative layout I just want to know what I’m doing wrong with this bit of code. Thanks.

#

Edit 6/3/2011:

<?xml version="1.0" encoding="utf-8"?>  
<LinearLayout android:id="@+id/LinearLayout01"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
            <TextView 
                android:id="@+id/lblQuote" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="Filler Text"/>
        </LinearLayout>
        <LinearLayout 
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="left">
           <ImageView
                android:id="@+id/imgUp"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/thumbsup"
                android:layout_gravity="left"/>
           <TextView 
                android:id="@+id/lblLikes" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"
                android:text="10"
                android:layout_gravity="left"/>

           <TextView 
                android:id="@+id/lblBuzzedTitle" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:textSize="4pt"
                android:text="Buzz Level:"/>
            <TextView 
                android:id="@+id/lblShared" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:text="Shared By: Filler Name"
                android:textSize="4pt"/>
            <TextView 
                android:id="@+id/lblSaid" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:text="Said By: Filler Name"
                android:textSize="4pt"/> 
        </LinearLayout>
        <LinearLayout 
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="left">
            <ImageView
                android:id="@+id/imgDown"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/thumbsdn"
                android:layout_gravity="left"/>
          <TextView 
                android:id="@+id/lblHates" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textSize="4pt"
                android:text="2"
                android:layout_gravity="left"/>

           <TextView 
                android:id="@+id/lblBuzzed" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:text="High"
                android:textSize="4pt"/>
            <TextView 
                android:id="@+id/lblDate" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:textSize="4pt"
                android:text="04/04/1987 4:32 PM"/>
            <TextView 
                android:id="@+id/lblLocation" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:textSize="4pt"
                android:text="Broomfield, CO"/> 
        </LinearLayout>
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:weightSum="1">
          <TextView
            android:text=" "
            android:textSize="1pt"
            android:background="#6F7285"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"/>  

        </LinearLayout>
</LinearLayout>

enter image description here

  • 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-22T23:05:42+00:00Added an answer on May 22, 2026 at 11:05 pm

    In the second version, your first nested LinearLayout has a layout_height of fill_parent. That pushes everything else down off the screen. Whenever you see yourself using layout_weight when you are also using fill_parent for both width and height, then you know that you are doing something wrong.

    What are you trying to accomplish, exactly?

    By the way, you don’t need to use weightSum the way you are doing. If you don’t specify it, it will automatically sum up the layout_weight values of all the child views. It’s main use is to distribute only a fraction of the total extra space available.

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

Sidebar

Related Questions

I am trying to make it such that the layout looks like the following
I have a 3 column layout, and am trying to make it more responsive
I am trying to make my layout look like so. I have tried gridviews,
I have been trying to make a layout for an Android app that functions
I am trying to make a simple layout like this: --------- - - -
I am trying to make Layout that contains 2 layout, vertical and horizontal scrolls.
I am trying to make a chatroom layout like the following: Now my problem
I'm trying to make a layout that is something similar to how the android
While trying to make a layout for my app, I noticed that while using
I'm trying to make scrollable RelativeLayout, that contains some custom Views. This is 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.