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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:50:16+00:00 2026-05-23T13:50:16+00:00

I have a ListView that is populated with rows. These rows come from an

  • 0

I have a ListView that is populated with rows. These rows come from an XML file that looks like:

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dip"
android:weightSum="100">
<TextView
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:id="@+id/columnA"
    android:layout_weight="30"
    android:layout_gravity="center"/>  
<TextView
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:id="@+id/columnB" 
    android:layout_weight="30"
    android:layout_gravity="center"/>
<ImageView 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:src="@drawable/icon" 
    android:id="@+id/columnC"
    android:layout_weight="10"
    android:layout_gravity="center"
    >
</ImageView>       
<CheckBox
    android:layout_width="0dp"
    android:layout_height="wrap_content" 
    android:id="@+id/columnD"
    android:layout_weight="30"
    android:layout_gravity="center"/>

The problem is that I want the columnC item and columnB item to be very close together, so that my rows are equally spaced out in three parts, i.e.: columnA, (columnB+columnC) and then columnD. I tried to achieve this by using layout_weight as you can see, however the above code seems to have the opposite effect. columnA and columnB are very squished on the left, column C seems to be floating in a large space on its own, and then columnD is located close to columnC, with too much space on its right. What am I doing wrong? :s

  • 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-23T13:50:17+00:00Added an answer on May 23, 2026 at 1:50 pm

    I would think that you want columnC and columnB to have the same weight, but you have it set with them different.

    Try

    columnA:weight=2

    columnB:weight=1

    columnC:weight=1

    columnD:weight=2

    I have very limited experience with the weight attribute but I think this is how you can get your desired result.

    If you’re still having trouble with it, may help us help you if you can post a screen shot of how it looks, and how you want it to look.

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

Sidebar

Related Questions

I have a listview that's populated by rows that get their data from a
I have a ListView that is populated using an XML file. However, I want
I have a listview populated by a text file hosted on my website that
I have a listview that is populated by a by objects from an Offer
I have a ListView that looks like this: Notice how the TextView is getting
I have a ListView that is populated with 50 items. This is the xml
I have a ListView in my activity that is populated from a database Cursor
I have a listview which is populated by a SimpleCursorAdapter that is binding data
I have a ListView that contains a large collection of rows with textboxes that
I have a simple ListView that gets populated using an array of SimpleAdapter s.

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.