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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:22:21+00:00 2026-06-08T00:22:21+00:00

I have a listview with a custom row layout. In this custom row is

  • 0

I have a listview with a custom row layout. In this custom row is a progressbar ( “circle” ) which indicates a loading state. To make the layout looks how i like it, im using layout_weight for the progressbar and the layout containing some other gui stuff.

Example:

<ProgressBar
    android:id="@+id/progressBar1"
    style="?android:attr/progressBarStyleSmall"
    android:layout_width="0dip" 
    android:layout_height="match_parent" 
    android:layout_weight="1" />


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="0dip" 
    android:layout_height="match_parent" 
    android:layout_weight="7"
    android:layout_marginLeft="6dip" 
    android:orientation="vertical"
    >

I want the progressbar to have the same aspect ratio.

My problem is that the progressbar looks weird on different devices. On my galaxy nexus everything looks fine and the progressbar has the same aspect ratio. But on – for example – my emulator, the progressbar looks like an egg and thats terrible.

Can someone please point out my error?

Edit:

I dont use wrap_content because the layout will use the progressbar’s width for the rest of the view, which is really tiny ( then there is no place for the text ).

Edit2:

Two pictures showing the problem:

The “egg”
http://s14.directupload.net/file/d/2955/89xvdhrz_png.htm

Usage of the wrap_content
http://s1.directupload.net/file/d/2955/sryrhkkk_png.htm

Edit3:

CFlex’ approach. Whole xml-file

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:orientation="horizontal">

<ProgressBar
    android:id="@+id/progressBar1"
    style="?android:attr/progressBarStyleSmall"
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:layout_gravity="center"
    android:layout_margin="4dp"/>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="0dip" 
    android:layout_height="match_parent" 
    android:layout_weight="7"
    android:layout_marginLeft="6dip" 
    android:orientation="vertical"
    >

    <TextView 
        android:id="@android:id/text1" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:textAppearance="?android:attr/textAppearanceLarge"/>

    <TextView 
        android:id="@android:id/text2" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:textAppearance="?android:attr/textAppearanceSmall"/>

</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-08T00:22:23+00:00Added an answer on June 8, 2026 at 12:22 am

    Why don’t you try something like this:

    <ProgressBar
        android:id="@+id/progressBar1"
        style="?android:attr/progressBarStyleSmall"
        android:layout_width="wrap_content" 
        android:layout_height="match_parent"  
        android:layout_gravity="center"
        android:layout_margin="4dp"/>
    
    
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="0dp" 
        android:layout_height="match_parent" 
        android:layout_weight="1"
        android:layout_marginLeft="6dip" 
        android:orientation="vertical"
        >
    

    Assuming you are in a horizontal LinearLayout

    Tell me if this does not work.

    EDIT: with a relativeLayout

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content">
    
        <ProgressBar
                android:id="@+id/progressBar1"
                style="?android:attr/progressBarStyleSmall"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:layout_margin="4dp"/>
    
        <TextView
                android:id="@android:id/text1"
                android:layout_toRightOf="@+id/progressBar1"
                android:layout_alignParentTop="true"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"/>
    
        <TextView
                android:layout_toRightOf="@+id/progressBar1"
                android:layout_below="@android:id/text1"
                android:id="@android:id/text2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceSmall"/>
    
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView which contains custom rows. This custom row has following UI
I have made a custom listView which which extends ListActivity and each row contains
I am extending BaseAdapter to make a custom listview row. I have context menu
I have a listview with custom row having a textview and a clickable image
I have a ListView that has a custom ArrayAdapter with a custom XML row.
I have a listView with custom objects defined by the xml-layout below. I want
I have a listview with custom rows and that extends SimpleAdapter. Each row consist
I am populating the ListView from my Custom DataAdaptor. I have a layout defined
I have an activity with a ListView which is populated through a custom ArrayAdapter.
I have a custom baseadapter which does some lazy loading of some images, and

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.