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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:44:35+00:00 2026-06-17T20:44:35+00:00

For building an application, we have several lists. the problem exists with a list

  • 0

For building an application, we have several lists.
the problem exists with a list item, which is custom, but very simple nontheless.
The format is:

enter image description here

This represents one list item with 2 textviews and one image view

Note that title and date are actually right underneath eachother and the image is on the right side, with center vertical as attribute.The image should NOT be in between the two text views

I will give the XML first and then explain the exact problem.

The XML:

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

    <LinearLayout 
        android:orientation="vertical" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <TextView 
            android:textSize="16dip" 
            android:id="@+id/title"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"/>

        <TextView 
            android:textSize="12dip" 
            android:id="@+id/date"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"/>
    </LinearLayout>
    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginRight="5dip" >

        <ImageView
            android:id="@+id/validationStateImg"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true" />
    </RelativeLayout>
</LinearLayout>

Problem:
In some sense, this layout displays everything exactly as the ascii representation.
What does NOT function correctly is when the text is becoming long. In cases where the text is long, but not long enough to take 2 lines, it just makes the imageview tiny.

In other cases, it just pushes imageview completely off the screen..

What I need is, when the length of either the date or the other textview is too long, to break to a new line. And ofcourse it needs to be a solution portable to all sorts of screen sizes.

I’m not a UI artist, so, apologies if I’m abusing layouts in a sense that they should not be used.

Aside help, tips and hints are also welcome!

  • 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-17T20:44:37+00:00Added an answer on June 17, 2026 at 8:44 pm

    I think your best bet is one simple RelativeLayout:

    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="8dp"
        >
        <ImageView
            android:id="@+id/validationStateImg"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentRight="true"
            android:gravity="center_vertical"
            />
        <TextView
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@id/validationStateImg"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:textSize="16dp"
            />
        <TextView
            android:id="@+id/date"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@id/validationStateImg"
            android:layout_alignParentLeft="true"
            android:layout_below="@id/title"
            />
    </RelativeLayout>
    

    Snap the ImageView to the right side of the parent, and let the TextViews take the rest of the width, but aligned to the left of the ImageView.

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

Sidebar

Related Questions

I have several listviews with two collumns like. I am building a stats application
I'm building a single-page application. At the moment, I also have several independent pages
I am building an android application that uses several third party libraries. I have
i'm building an android application which have a chat. in this chat i each
I have several classes in an application that I am currently building, and I
I am building an in-house application which would accumulate the information from several social
I have an application that I am building, that has a PageControl with several
I am currently building an application that consists of several components, each of which
We are building an application which makes every week a very large amount of
For illustration purposes let us say I'm building a simple blog application and have

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.