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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:07:36+00:00 2026-06-14T16:07:36+00:00

I need to display an ListView between a LinearLayout and a Relative Layout. I

  • 0

I need to display an ListView between a LinearLayout and a Relative Layout. I want that the height of the ListView to be display according to the screen dimensions. For that, I put layout_height=”wrap_content”, and I user layout_above and layout_belowm but this returns this :”Circular dependence cannot exist in RelativeLayout”.
Here is my layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/firstLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/roadmap_linearlayout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:gravity="center"
        android:orientation="horizontal" >
    ........
    </LinearLayout>

    <ListView
        android:id="@+id/listvisit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/roadmap_linearlayout"
        android:layout_above="@+id/relativelayout_listpostovisit"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:cacheColorHint="@android:color/transparent"
        android:divider="@drawable/listview_divider"
        android:dividerHeight="2dp"
        android:scrollbars="vertical" />

    <RelativeLayout
        android:id="@+id/relativelayout_listpostovisit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/listvisit"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:background="#FFFFFF"
        android:orientation="vertical"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true">

       .........

    </RelativeLayout>

</RelativeLayout>

Any idea how to solve this ?

Thanks in advance.

  • 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-14T16:07:38+00:00Added an answer on June 14, 2026 at 4:07 pm

    I want that the height of the ListView to be display according to the screen dimensions.

    I am going to translate this as meaning “I want the ListView to fill the available screen space”.

    For that, I put layout_height=”wrap_content”

    You cannot reliably use android:layout_height="wrap_content" on a ListView.

    and I user layout_above and layout_belowm but this returns this :”Circular dependence cannot exist in RelativeLayout”

    That is because your outer RelativeLayout configuration has relativelayout_listpostovisit depend upon the position of listvisit and the position of listvisit depend upon the position of relativelayout_listpostovisit. That cannot work.

    Either:

    • Change relativelayout_listpostovisit, removing android:layout_below="@id/listvisit" and adding android:layout_alignParentBottom="true", or

    • Switch the outer container to be a LinearLayout rather than a RelativeLayout and switch to using android:layout_weight to allocate extra space to the ListView.

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

Sidebar

Related Questions

I have a string-array, that i need to display in a layout. The code
I need to display image and text in my listview when i click a
I have a ListView that displays a link button. I need the link button
I need to display a ListView in WinForms which should not have any lines
I need to display results from a SQL join in a ListView/ListActivity. I've created
I have a ListView which sometimes I need to put around 10000 items in.
I'm working on expandable listview. I need to display different images in imageview of
Im using one edittext and listview in my app. i need to display the
I need to display a checkbox dynamically in a listview (one checkbox per list
I need to display the customer's email and phone numbers in listview and address

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.