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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:10:52+00:00 2026-05-22T00:10:52+00:00

This has had me stumped for a bit and I can’t seem to figure

  • 0

This has had me stumped for a bit and I can’t seem to figure it out.

I am creating a chat interface with side by side relative layouts in a custom adapter.

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="wrap_content"
    android:layout_weight="1" android:layout_height="wrap_content">
    <RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="wrap_content" android:layout_weight="1" android:layout_height="wrap_content">
        <TextView android:id="@+id/lefttext" android:text="TextView" android:layout_width="fill_parent" android:gravity="top" android:layout_height="wrap_content" android:paddingLeft="10dip" android:paddingRight="10dip" android:paddingTop="5dip" android:layout_alignParentLeft="true"></TextView>
    </RelativeLayout>
    <RelativeLayout android:id="@+id/relativeLayout2" android:layout_width="wrap_content" android:layout_weight="1" android:layout_height="wrap_content">
        <TextView android:id="@+id/righttext" android:layout_width="fill_parent" android:text="TextView" android:layout_height="wrap_content" android:paddingLeft="10dip" android:paddingRight="10dip" android:paddingTop="5dip" android:layout_alignParentLeft="true" android:layout_alignParentTop="true"></TextView>
    </RelativeLayout>
</LinearLayout>

Now, in a layout view everything looks like it would be perfectly fine. But here’s a screenshot of what it looks like on my device:

![enter image description here][1]

The layout on the left sizes the height the way I want it to, but the layout on the right has a big space above it.. Here’s how I’m setting the cell background and resources

            if (wasMine == 0) 
            {
                lt.setText(Message);
                leftLayout.setBackgroundResource(R.drawable.speechbubblefrom);
                rightLayout.setBackgroundDrawable(null);
                rt.setText(""); 

            }
            else if (wasMine == 1)
            {
                rt.setText(Message);
                rightLayout.setBackgroundResource(R.drawable.speechbubbleto);
                leftLayout.setBackgroundDrawable(null);
                lt.setText("");
            }

Any ideas?

  • 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-22T00:10:54+00:00Added an answer on May 22, 2026 at 12:10 am

    Try removing the layout_alignParentTop from the right TextView. If that isn’t it, are your background drawables 9-patches? Have you ensured that your 9-patch is correctly stretched?

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

Sidebar

Related Questions

Okay people, I'm sure someone has had this issue and can help me out.
Has anyone had this unusual(recurring) experience before? I'm trying to check out the project
I have a question that has had me stumped for a bit, I thought
I'm sure this is easy but it has had me stumped for ages. I
Ok, this has had me stumped for a while - One of our clients
I'm aware that MD5 has had some collisions but this is more of a
I'm really asking this by proxy, another team at work has had a change
Has anyone had this problem? I deleted a column in the table editor and
Has anyone had this problem? My projects tend to have some long XML files
This probably has a simple answer, but I must not have had enough coffee

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.