Note that there are some explanatory texts on larger screens.

plurals
  1. POThe TextView is not shown and the ScrollView is not scrolling
    primarykey
    data
    text
    <p>I want a sticky TextView above a ScrollView:</p> <p>The text view should cover 50% of the screen so I set the textview's and the inner linear layout's weight to "1".</p> <p>But the TextView is not shown at all and the ScrollView is not scrolling!</p> <p>any help would be greatly appreciated!</p> <pre><code>&lt;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="#000000" tools:context=".MainActivity" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/wallbg" android:gravity="bottom" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="center" android:height="0dp" android:text="Some Text!" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="@android:color/white" android:textSize="50sp" /&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@drawable/wallbg" android:gravity="bottom" android:orientation="vertical" &gt; &lt;ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;Button android:id="@+id/btn1" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:background="@drawable/btnbg" android:text="Some Text!" android:textColor="@android:color/white" android:textSize="@dimen/font_size" /&gt; &lt;Button android:id="@+id/btn4" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:background="@drawable/btnbg" android:text="Some Text!" android:textColor="@android:color/white" android:textSize="@dimen/font_size" /&gt; &lt;Button android:id="@+id/btn2" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:background="@drawable/btnbg" android:text="Some Text!" android:textColor="@android:color/white" android:textSize="@dimen/font_size" /&gt; &lt;Button android:id="@+id/btn3" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:background="@drawable/btnbg" android:text="Some Text!" android:textColor="@android:color/white" android:textSize="@dimen/font_size" /&gt; &lt;/LinearLayout&gt; &lt;/ScrollView&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    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