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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:12:31+00:00 2026-05-27T05:12:31+00:00

I have a ListView which uses a custom adapter to display rows of data.

  • 0

I have a ListView which uses a custom adapter to display rows of data. Each row contains two TextViews; one is left-justified and one is right-justified.

Ideally what I want is for each TextView to take up at most half of the width of the row. I’ve accomplished this using the following row xml layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
    android:id="@+id/description"
    style="@style/ProductSpecNameFont"
    android:layout_width="fill_parent"
    android:layout_gravity="left"
    android:layout_weight="1"
    android:padding="@dimen/margin_sides"
    android:text="Display Size" />

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1" >

    <TextView
        android:id="@+id/value"
        style="@style/ProductSpecValueFont"
        android:layout_alignParentRight="true"
        android:padding="@dimen/margin_sides"
        android:text="3.5 Inches" />
</RelativeLayout>

This “almost” works perfectly. The problem is that the rows which contain text on the right-side TextView that takes up multiple lines are not right-justified. The single-line rows are right-justified as I would like. Here is a screenshot of what I’m talking about:

Screen

Why aren’t the multiple-line TextViews right-justified, and how can I make them so?

  • 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-27T05:12:31+00:00Added an answer on May 27, 2026 at 5:12 am

    Try setting the gravity of the TextView. It looks like what’s happening is the TextView is aligned to the right, but the text itself is left justified.

    android:gravity="right"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ListView which as one TextView in each Row. and im discovering some
I have a custom ListView that uses a custom ArrayAdapter (which basically just overrides
I have a ListView which uses a CursorAdatper as its adapter. I would like
I have one ListView which is showing me some data through an array (which
I have a ListView which is using a GridView to display a DataTable and
I have a WPF ListView which repeats the data vertically. I cannot figure out
I have a listview with lists lines of an invoice (Which are editable), each
I have a dynamic ListView which uses an ArrayAdapter . When a name is
I currently have an application which uses a regular ListView with groups to show
I have a following problem. I have a ListView which returns data from SQL

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.