Note that there are some explanatory texts on larger screens.

plurals
  1. POPlace a fixed height button at the bottom of the screen always
    primarykey
    data
    text
    <p>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. </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"&gt; &lt;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" /&gt; &lt;ScrollView android:id="@+id/Scroll" android:layout_width="match_parent" android:layout_height="wrap_content"&gt; &lt;LinearLayout android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"&gt; &lt;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" /&gt; &lt;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" /&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="bottom"&gt; &lt;Button android:id="@+id/btBottom" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Enter" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>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.</p> <p>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. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload