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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:29:13+00:00 2026-05-31T00:29:13+00:00

I wish to keep a button at the bottom of my Activity screen. It

  • 0

I wish to keep a button at the bottom of my Activity screen. It has to be fixed irrespective of the size of scrollview above it. The problem is that once the textviews of the scrollview take up some place, the height of my button keeps decreasing and it eventually gets pushed out of the activity screen. This is the layout I am using.

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

    <TextView android:id="@+id/tvBanner" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" android:gravity="center"
        android:text="Practice Exam" />


    <ScrollView android:id="@+id/Scroll" android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout android:id="@+id/LinearLayout1"
            android:layout_width="match_parent" android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView android:id="@+id/tvDesc" android:layout_width="fill_parent"
                android:layout_height="wrap_content" android:layout_margin="10dp"
                android:gravity="center" android:paddingTop="40dp" android:text="@string/welcom"
                android:textSize="20sp" />

            <TextView android:id="@+id/tvURL" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_marginBottom="30dp"
                android:paddingTop="10dp" android:layout_gravity="center"
                android:text="hello" android:textColor="@android:color/white"
                android:typeface="sans" />
        </LinearLayout>
    </ScrollView>

    <RelativeLayout android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:gravity="bottom">

        <Button android:id="@+id/btBottom" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_weight="1"
            android:text="Enter" />

    </RelativeLayout>



</LinearLayout>

I have also tried using android:weight=1 and android:layout_height=0dp in the Scrollview. But this removes the entire Scrollview portion from my activity and I can’t see anything.

I do know that there are many similar questions asked about this and believe me, I have tried many of these. However, none of the tricks have worked for me. I have spent almost half a day fixing this. Kindly help.

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

    For a case like this always use RelativeLayouts. A LinearLayout is not intended for such a usage.

    Try this:

    <RelativeLayout 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"         
        android:layout_centerHorizontal="true">
    
        <Button android:id="@+id/btBottom"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Enter" 
            android:layout_alignParentBottom="true"/>
    
       <ScrollView
          ...
          android:layout_above="@id/btnGetMoreResults"/>
    </RelativeLayour>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've developing a Cocoa app that has certain resources (images) which I wish to
We are moving from Mantis to JIRA and wish to keep Mantis alive for
We are looking for approach to implement shopping-cart that keep shopping items at the
Like this question , I wish to keep track of the number of page
I have the following problem using UNIX Commands. I wish to go through a
I have a simple contact from that i wish to POST via a function
Outside of work I use SVN for my personal projects I wish to keep
I have two WCF services which are logically different and I wish to keep
Preface: I'm developing an application that quizzes users on multiple topics. I wish to
I need to know how many times a button in my program has been

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.