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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:39:04+00:00 2026-06-18T01:39:04+00:00

I use the layout posted below to show messages by inflating that layout as

  • 0

I use the layout posted below to show messages by inflating that layout as a row into a ListView. The problem is that it works fine with a single-line message but when there are 2 lines or more the ImageView indicating the message state gets pushed off the screen, can’t get the reason. Any ideas? Layout code and screenshot below.

enter image description here

That is the inflated layout:

    <?xml version="1.0" encoding="utf-8"?>
   <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
   android:layout_height="match_parent"
    android:padding="5dp" >

<TextView
    android:id="@+id/tvTimestamp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:text="TextView"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:textSize="8sp" />

<LinearLayout
    android:id="@+id/rl_message_holder"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:layout_toRightOf="@+id/tvTimestamp"
    android:background="@drawable/outgoing_bg"

    android:orientation="horizontal" >

    <TextView
        android:id="@+id/tvMessageOutgoing"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="4dp"
        android:text="Medium Text"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <ImageView
        android:id="@+id/imgMessageState"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_gravity="bottom"
        android:src="@drawable/ic_launcher" />

  </LinearLayout>

 </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-06-18T01:39:05+00:00Added an answer on June 18, 2026 at 1:39 am
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/RelativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="5dp" >
    
        <TextView
            android:id="@+id/tvTimestamp"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="20"
            android:gravity="center_vertical"
            android:text="10:20pm"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textSize="8sp" />
    
        <RelativeLayout
            android:id="@+id/rl_message_holder"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="80" >
    
            <TextView
                android:id="@+id/tvMessageOutgoing"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_toLeftOf="@+id/imgMessageState"
                android:padding="4dp"
                android:singleLine="false"
                android:text="android developer tutorial in the world"
                android:textAppearance="?android:attr/textAppearanceMedium" />
    
            <ImageView
                android:id="@+id/imgMessageState"
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_gravity="bottom"
                android:contentDescription="@string/app_name"
                android:src="@drawable/ic_launcher" />
        </RelativeLayout>
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to Rob Allen's tutorial : to use a layout into my zend application
let's consider two views that use the same layout composed of: A left column
can I change layout dpi that use my application on device? (on developed application
I have a problem. I'd like to use layout for designe this ArcTimerActivity. When
I'm trying to use FB Connect on my app, and everything works fine in
To use custom layout file in my app I'm using this following code, set
I am trying to use a layout for each actions in a controller. For
I am trying to use relative layout in my app. With two TextViews and
I'm using Facebook Registration in my application. Is it possible to use customized layout
I'm trying to learn how to use the force.layout features in D3.js 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.