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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:52:32+00:00 2026-06-12T16:52:32+00:00

I was trying to use relative layout but the header becomes in front of

  • 0

I was trying to use relative layout but the header becomes in front of the text. So all was going to wrong direction.
My app screen looks like:
image

I would like to add also footer but every time I try it fails. Im pretty sure that all widths and heights are okay in my xml layout.

Here is my xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/main"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/header"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/item1"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:height="30dip"
            android:text="@string/item1" />

        <TextView
            android:id="@+id/item2"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:height="30dip"
            android:text="@string/item2" />

        <TextView
            android:id="@+id/item3"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:height="30dip"
            android:text="@string/item3" />

        <TextView
            android:id="@+id/item4"
            android:layout_width="0dp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:height="30dip"
            android:text="@string/item4" />
    </LinearLayout>

    <!-- List Divider -->

    <View
        android:layout_width="fill_parent"
        android:layout_height="1dip"
        android:background="?android:attr/listDivider" />

    <!-- ListView (grid_items) -->

    <LinearLayout
        android:id="@+id/layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

        <ListView
            android:id="@+id/listview"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >
         </ListView>

    </LinearLayout>

</LinearLayout>

Please give me any suggestion. I think that relative layout would be great idea but I do not know much about it yet.

  • 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-12T16:52:34+00:00Added an answer on June 12, 2026 at 4:52 pm

    1/ Use a RelativeLayout for ‘main’.

    2/ Add the attribute android:layout_alignParentTop=”true” to ‘header’.

    3/ Remove the LinearLayout with id ‘layout’, it’s not needed.

    4/ Add your footer to the end of the XML. When specifying its id, use @id not @+id. Give it an attribute android:layout_alignParentBottom=”true”.

    5/ Add the following attributes to the ListView:

    android:layout_below="@id/header"
    android:layout_above="@+id/the_id_you_give_the_footer"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use relative layout in my app. With two TextViews and
Im trying to create a app but it wont all fit on the screen.
I'm trying to use a mapview object in my app, but I need to
I am trying to use relative url with a post ajax call as follows:
I am trying to use JavaScript to set an elements width relative to their
I am trying use a Java Uploader in a ROR app (for its ease
Hi all (especially CommonsWare) I am trying to use the TouchListView of CommonsWare. The
I'm trying to use a PopupWindow with a Gallery inside, but when inflating the
I am trying to place Admob ads in my app, and I followed all
Within an XSL stylesheet, I'm trying to use the document() function with a relative

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.