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

  • Home
  • SEARCH
  • 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 9014333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:28:57+00:00 2026-06-16T03:28:57+00:00

This layout is used as the layout for items in a listView. I had

  • 0

This layout is used as the layout for items in a listView. I had a really simple layout, and everything was working fine, but now i have changed it a little and it is crashing my app when it tries to load.. Not sure what im doing wrong

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:weightSum="8"
    android:layout_width="fill_parent"
    android:layout_height="75dp">

   <TextView android:id="@+id/priceText"
        android:layout_weight="2"
        android:layout_height="fill_parent"
        android:gravity="center_vertical"
        android:layout_alignParentTop="true"
        android:layout_alignParentBottom="true"
        android:textStyle="bold"
        android:textSize="22dp"
        android:textColor="#000000"
        android:layout_marginTop="5dp"
        android:layout_marginBottom="5dp" 
        android:layout_marginLeft="5dp" />

   <LinearLayout
        android:layout_weight="5"
        android:layout_height="fill_parent"
        android:weightSum="2" 
        android:orientation="vertical">

       <TextView android:id="@+id/storeText"
            android:layout_width="fill_parent"
            android:layout_weight="1"
            android:gravity="right|bottom"
            android:textStyle="bold"
            android:textSize="22dp"
            android:textColor="#000000"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="5dp" />

       <TextView android:id="@+id/distanceText"
            android:layout_width="fill_parent"
            android:layout_weight="1"
            android:gravity="right|top"
            android:textSize="16dp"
            android:textColor="#545454"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="5dp" />

   </LinearLayout>

   <TextView
       android:layout_height="fill_parent"
       android:layout_alignParentBottom="true"
       android:layout_alignParentTop="true"
       android:layout_marginBottom="5dp"
       android:layout_marginTop="5dp"
       android:layout_weight="1"
       android:gravity="right|center_vertical"
       android:text=">"
       android:textColor="#000000"
       android:textSize="36dp"
       android:textStyle="bold" 
       android:layout_marginRight="5dp" />

</LinearLayout>
  • 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-06-16T03:28:58+00:00Added an answer on June 16, 2026 at 3:28 am

    When you use android:layout_weight put layout_width=”0dip”

    Working code

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:weightSum="8"
        android:layout_width="fill_parent"
        android:layout_height="75dp">
    
       <TextView android:id="@+id/priceText"
            android:layout_weight="2"
            android:layout_width="0dip"
            android:layout_height="fill_parent"
            android:gravity="center_vertical"
            android:layout_alignParentTop="true"
            android:layout_alignParentBottom="true"
            android:textStyle="bold"
            android:textSize="22dp"
            android:textColor="#000000"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="5dp" 
            android:layout_marginLeft="5dp" />
    
       <LinearLayout
            android:layout_weight="5"
            android:layout_width="0dip"
            android:layout_height="fill_parent"
            android:weightSum="2" 
            android:orientation="vertical">
    
           <TextView
               android:id="@+id/storeText"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:layout_marginBottom="5dp"
               android:layout_marginTop="5dp"
               android:layout_weight="1"
               android:gravity="right|bottom"
               android:textColor="#000000"
               android:textSize="22dp"
               android:textStyle="bold" />
    
           <TextView
               android:id="@+id/distanceText"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:layout_marginBottom="5dp"
               android:layout_marginTop="5dp"
               android:layout_weight="1"
               android:gravity="right|top"
               android:textColor="#545454"
               android:textSize="16dp" />
    
       </LinearLayout>
    
       <TextView
           android:layout_height="fill_parent"
           android:layout_width="wrap_content"
           android:layout_alignParentBottom="true"
           android:layout_alignParentTop="true"
           android:layout_marginBottom="5dp"
           android:layout_marginTop="5dp"
           android:layout_weight="1"
           android:gravity="right|center_vertical"
           android:text=">"
           android:textColor="#000000"
           android:textSize="36dp"
           android:textStyle="bold" 
           android:layout_marginRight="5dp" />
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't like this ugly FileChooser layout in Linux. This layout is used by
I have this layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=wrap_content android:orientation=horizontal android:gravity=left> <LinearLayout android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=horizontal>
OK I have this layout in XML & and this code, what I am
I have this layout that works correctly, a relative layout with a text view
I have a ListView-like control that displays a list of items of various heights.
I'm used to the fact that items of listview without any problem (even with
I have a Listview to show some item and i have also used an
I have this code i am used to pass an array list to another
So I had my listview working perfectly then I decided to add a context
I have a Listview that originally listed items from a menu item with one

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.