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

  • Home
  • SEARCH
  • 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 8668279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:10:26+00:00 2026-06-12T18:10:26+00:00

To allow users to submit comments, I have 2 views, vertically stacked. A ListView

  • 0

To allow users to submit comments, I have 2 views, vertically stacked. A ListView for displaying entered comments and a LinearLayout footer, for allowing the user to add a comment (which is basically an EditText and a button).

The footer must be anchored to the foot of the screen and the ListView must sit above it. Its similar to what you see on facebook for Android when you are adding comments.

However I don’t want the ListView to initially take up the full space – I want it to take up only the space required to display its rows, but to be able to grow into the remaining space as the user adds comments – while always staying above the footer layout.

I’ve tried a LinearLayout as suggested here Android: How can you align a button at the bottom and listview above?

However, this results in the ListView taking up all the space above the footer – when there is only a couple of comments – so its mainly empty and looks weird.

I have tried a RelativeLayout parent, where the footer is anchored using android:layout_alignParentBottom="true"….. Positioning the ListView above the footer using android:layout_above="@id/footerLayout" forces the same behaviour as above (ListView takes up all remaining space)… removing this allows the ListView to ‘grow’ but it overlaps the footer if its grows too big.

Cheers.

  • 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-12T18:10:28+00:00Added an answer on June 12, 2026 at 6:10 pm

    I guess this workaround will work!

    <LinearLayout
        layout_width="MATCH_PARENT"
        layout_height="MATCH_PARENT"
        orientation="vertical">
        <LinearLayout
            layout_width="MATCH_PARENT"
            layout_height="0"
            android:weight="1"
            orientation="vertical">
            <YOURLIST
                layout_width="MATCH_PARENT"
                layout_height="wrap_content"
            />
        </LinearLayout>
        <YOURVIEW
             android:layout_width="MATCH_PARENT" 
             android:layout_height="WRAP_CONTENT" 
             android:weight="0"/>
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Pictures section on my website and allow users to enter comments
I allow users to submit a question, and they should be able to have
I want to create a bookmarklet that will allow users to submit URLS from
I have a html page that allows users to submit a file. Below is
We have here a strange issue. We have a comments form where users can
We allow users to submit a file to allow batch upload so they won't
I have a form in my app and I would like to allow users
I'm building a review site that will allow users to submit reviews which will
I need to allow users to submit a form value containing html in their
I allow users to submit a query at mysite.com/go/QUERY\ If the query contains /

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.