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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:38:30+00:00 2026-05-14T00:38:30+00:00

I have problems getting some of my views aligned in a relative layout that

  • 0

I have problems getting some of my views aligned in a relative layout that I use inside a row of my listview.

Here is a screenshot from the layout builder in Eclipse, this is what I think it should look like:

alt text
(source: janusz.de)

The next image is from the emulator. Now the TestTestTest View is at the top and covers the name and distance Textviews.

alt text
(source: janusz.de)

This is my layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:padding="4dip">

<ImageView android:id="@+id/logo" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:adjustViewBounds="true"
    android:scaleType="centerInside" android:src="@drawable/icon"
    android:layout_centerVertical="true" android:layout_alignParentLeft="true"
    android:background="@color/green" />

<TextView android:id="@+id/distance" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:text="Distance"
    android:layout_alignParentRight="true" android:layout_alignParentTop="true"
    android:paddingRight="4dip" android:background="#000000" />

<TextView android:id="@+id/name" android:layout_width="fill_parent"
    style="@style/ListHeadText" android:layout_height="wrap_content"
    android:text="Name"
    android:layout_alignTop="@id/distance" android:layout_toRightOf="@id/logo"
    android:layout_toLeftOf="@id/distance" android:gravity="clip_horizontal"
    android:lines="1" android:paddingLeft="4dip" android:background="@color/red" />

<TextView android:id="@+id/number" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:text="Number"
    android:paddingRight="4dip" android:layout_alignRight="@id/distance"
    android:background="@color/darkred" android:layout_below="@id/distance" />

<TextView android:id="@+id/subcategory" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:text="Subcategory"
    android:paddingLeft="4dip" android:layout_alignLeft="@id/name"
    android:lines="1" android:gravity="clip_horizontal"
    android:layout_below="@id/distance" android:background="@color/green" />

<TextView android:id="@+id/test" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:text="TestTestTest"
    android:paddingLeft="4dip" 
    android:layout_alignParentBottom="true" android:gravity="bottom"
    android:background="@color/red" />

Shouldnt align_parent_bottom put the view at the bottom of the cell in the list?

  • 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-14T00:38:31+00:00Added an answer on May 14, 2026 at 12:38 am

    Try adding android:layout_alignParentLeft="true" as well; sometimes Views aren’t displayed properly if it can’t anchor the view with at least 2 points. Also, is this RelativeLayout used within a ListView? If so, you might find you have some difficulty getting it to look right. There was another question where someone was having a problem where the RelativeLayout looked right on its own, but not once it was included as part of a ListView. We didn’t manage to figure out what went wrong so he had to use nested LinearLayouts instead.

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

Sidebar

Related Questions

I'm getting some strange behavior from a listview/the getChildAt method. I have a HashSet,
I have a problem with getting my pager-function to work. For some reason it
I have no problems getting the Json to work and parse the json return.
I'm trying to create a SVN Eclipese EFS plugin and have problems when getting
Ever since deleting the original settings.settings file I have had endless problems getting the
I have had a few problems getting this right, so I wanted to ask
I am having problems getting my Permalinks changed with my Wordpress instance. I have
I'm pretty new to android development, and I've been having some problems getting my
I'm having some problems getting a UIImage from a CVPixelBuffer . This is what
I have some problems using Code Igniter and I feel there is something I

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.