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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:05:40+00:00 2026-06-15T17:05:40+00:00

I have a button that’s below a ScrollView , the button is set to

  • 0

I have a button that’s below a ScrollView, the button is set to align to the parents bottom. The scroll view is set to wrap_content for its height. Once the ScrollView is filled with content it appears beneath the button. How can I set it to not go behind the button, for the ScrollViewto end when the button begins?

I’ve tried placing android:layout_below in the bottom button, and when that didn’t work I tried layout_above in the ScrollView for above the button. That last one caused my app to crash on start, no idea why. The first one once the ScrollView is longer than the screen it causes the button to be placed underneath with no way to access it.

Here’s my XML file.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/light_blue"
    android:padding="5dp"
    tools:context=".MainActivity" >

    <EditText
        android:id="@+id/editText_query"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/queryPromt"
        android:imeOptions="actionNext"
        android:inputType="text"
        android:textColor="#000" />

    <EditText
        android:id="@+id/editText_tag"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/editText_query"
        android:layout_marginTop="10dp"
        android:layout_toLeftOf="@+id/saveButton"
        android:hint="@string/tagPrompt"
        android:imeOptions="actionDone"
        android:inputType="text" />

    <Button
        android:id="@id/saveButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_below="@id/editText_query"
        android:text="@string/save" />

    <TextView
        android:id="@+id/textView_taggedSearches"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignRight="@id/saveButton"
        android:layout_below="@id/saveButton"
        android:layout_marginTop="10dp"
        android:background="#666"
        android:gravity="center_horizontal"
        android:text="@string/taggedSearches"
        android:textColor="#FFF"
        android:textSize="18sp" />

    <ScrollView
        android:id="@+id/scrollView_query"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/textView_taggedSearches"
        android:padding="5dp" >

        <TableLayout
            android:id="@+id/tableLayout_query"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="5dp"
            android:stretchColumns="*" >
        </TableLayout>
    </ScrollView>

    <Button
        android:id="@+id/button_clearTags"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:text="@string/clearTags" />

</RelativeLayout>
  • 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-15T17:05:41+00:00Added an answer on June 15, 2026 at 5:05 pm

    You can use layout_weight for this. If you set layout_height to “0px” you can use layout_weight to distribute the remaining parent space between sibling items.

    In this case you want the button to have its normal size, and the scrollview to occupy whatever space remains. This should give you the general idea:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent" >
    
        <ScrollView
         android:layout_width="fill_parent"
         android:layout_height="0px"
         android:layout_weight="1" >
    
            <TableLayout
             android:layout_width="fill_parent"
             android:layout_height="wrap_content" />
    
        </ScrollView>
    
        <Button
         android:layout_width="wrap_content"
         android:layout_height="wrap_content" />
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button that has its content (text) set dynamically via a style
I have a button that, when tapped, adds a label inside a view. Anytime
I have a button that changes the background of a div when its rolled
I have a button that when hovered over (mouseover) displays a div right below
I have button views that are part of a set of Ember.js form helpers
I have a button that shows or hides a view. When button get pressed
I have a button that - when pressed - loads up a table view.
I have a button that when pressed shows presents a view controller, this is
I have button that a user selects and I pop up a AlertDialog to
I have a button that can have a focus css class associated with it

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.