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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:51:54+00:00 2026-05-18T22:51:54+00:00

I have a listview with a custom adapter in which I have 3 textview

  • 0

I have a listview with a custom adapter in which I have 3 textviews, two are next to each other and one is below the others. The problem I am running into though, is when the first textview extends, it pushes the other textview off the screen.

I have not been able to successfully get this to work, here is an example of what’s happening:

alt text

As you can see when the first textview gets too long, it then pushes the other text off the screen. I would like it so it wraps but the date textview is also showing. It should also be functional in horizontal view.

Here’s the listview adapter code:

<RelativeLayout android:id="@+id/vw1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:descendantFocusability="blocksDescendants" xmlns:android="http://schemas.android.com/apk/res/android">


<TextView android:id="@+id/liName" android:textSize="17sp"
    android:textColor="#333" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:gravity="left"
    android:layout_gravity="left" />
<TextView android:id="@+id/liDate" android:textSize="12sp"
    android:textColor="#666" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:gravity="right"
    android:layout_gravity="right" android:width="60sp" android:layout_toRightOf="@+id/liName" />

<TextView android:id="@+id/liNum" android:textSize="12sp"
    android:textColor="#666" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:layout_below="@+id/liName" />


</RelativeLayout>
  • 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-18T22:51:54+00:00Added an answer on May 18, 2026 at 10:51 pm

    I am assuming that the text view being pushed is the liDate one.
    You need to put this one before the liName in your layout and set the width to “wrap_content” and align it right. Then you lace the liName to the left of it with “fill_parent” width
    So it would look like this:

    <RelativeLayout android:id="@+id/vw1" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:orientation="horizontal"
    android:descendantFocusability="blocksDescendants" xmlns:android="http://schemas.android.com/apk/res/android">
    
    
    <TextView android:id="@+id/liDate" android:textSize="12sp"
        android:textColor="#666" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:width="60sp" 
        android:layout_alignParentRight="true" />
    <TextView android:id="@+id/liName" android:textSize="17sp"
        android:textColor="#333" android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@id/liDate" />
    
    <TextView android:id="@+id/liNum" android:textSize="12sp"
        android:textColor="#666" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_below="@+id/liName" />
    

    Hope this is what you meant

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

Sidebar

Related Questions

I have implemented a custom list view which looks like the twitter timeline. adapter
I have a custom ListView that uses a custom ArrayAdapter (which basically just overrides
I have a ListView with a custom Adapter that extends ArrayAdapter. It's a ArrayAdapter
I have got ListView with a custom Adapter. Every row contains clickable buttons and
I have a ListView backed by a custom adapter based on a CursorAdapter. The
I have a problem with listview which list item contain a checkbox. When i
I have one activity in which I am having one TabHost with two tabs.
I have a ListView with a custom list adapter (that extends BaseAdapter). My list
I have a ListView that uses a custom adapter. The custom adapter's getView uses
I have a ListView which sometimes I need to put around 10000 items in.

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.