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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:20:55+00:00 2026-06-18T03:20:55+00:00

I faced a problem designing the layout for a chat. My XML is listed

  • 0

I faced a problem designing the layout for a chat. My XML is listed below.

So the layout consists of 3 parts: header (RelativeLayout with multiple Views inside it), the ListView and the footer (RelativeLayout with EditText and a Button). The Send button is placed beside the EditText, but the EditText can expand to a maximum of 6 lines and I need the button to stay on the bottom. A can’t use alignParentBottom, since it causes wrong dependencies and the footer expands pushing the ListView out of the screen. I also tried to change the layout to a linear one, but still can’t force the button to stay on the bottom when the ExitText expands to allow multiline input. Any suggestions are appreciated.

  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ChatActivity" >

<RelativeLayout
    android:id="@+id/RL_header"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:background="#7B7B7B"
    android:gravity="center_vertical" >

    <ImageView
        android:id="@+id/img_Contact_Icon"
        android:layout_width="55dp"
        android:layout_height="55dp"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:padding="5dp"
        android:src="@drawable/ic_launcher" />

    <TextView
        android:id="@+id/tvContactName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/img_Contact_Icon"
        android:layout_toRightOf="@+id/img_Contact_Icon"
        android:text="testname"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/tvPartnerRegion"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/img_Contact_Icon"
        android:layout_alignLeft="@+id/tvContactName"
        android:layout_marginBottom="5dp"
        android:text="@string/tvFrom"
        android:textAppearance="?android:attr/textAppearanceMedium" />


</RelativeLayout>

<RelativeLayout
    android:id="@+id/RL_footer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
     >

    <EditText
        android:id="@+id/etChatInput"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_toLeftOf="@+id/btnSend"
        android:ems="10"
        android:hint="@string/etWriteMessageHint"
        android:maxLines="6" />

    <Button
        android:id="@+id/btnSend"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"

        android:text="@string/btnSend" />

</RelativeLayout>

<ListView
    android:id="@android:id/list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/RL_footer"
    android:layout_below="@+id/RL_header"
    android:layout_centerHorizontal="true"
    android:divider="@android:color/transparent"
    android:dividerHeight="10.0sp" >
</ListView>

  • 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-18T03:20:56+00:00Added an answer on June 18, 2026 at 3:20 am

    enter image description here

    <LinearLayout
            android:id="@+id/lay"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:background="#000000"
            android:gravity="center|left"
            android:orientation="horizontal"
            android:weightSum="3" >
    
    
    
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1.8"
                android:gravity="center"
                android:padding="10dip" >
    
                <EditText
                    android:id="@+id/Box"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/message_focus"
                    android:hint="message_title"
                    android:imeOptions="actionDone"
                    android:padding="8dip"
                    android:singleLine="true"
                    android:textColor="#333"
                    android:textSize="12dip" />
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="fill_parent"
                android:layout_weight="0.6"
                android:gravity="center"
                android:paddingLeft="5dip" >
    
                <Button
                    android:id="@+id/Button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_launcher" />
            </LinearLayout>
        </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the most difficult problem you faced in web designing (javascript or css
I faced a problem with reading the XML. The solution was found, but there
I faced a problem in Visual studio 2008.When i click on Sorce Control Explorer(Views->
I faced problem in Icefaces portlet using portletfaces bridge inside liferay. the problem is
I faced the problem with white-space: pre-line in my layout. When I wrap content
I faced a problem. When you add multiple Set-Cookie headers to the response headers.Add(Set-Cookie,
I faced conflict problem during yacc compilation. Error message below: 24: shift/reduce conflict (shift
I've faced a problem of writing a backend on Java for the chat with
I faced the problem debugging my WPF-WCF simple chat application. There's an exception like:
I faced with problem, when I put value as String into List<String> inside <ui:repeat>

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.