Note that there are some explanatory texts on larger screens.

plurals
  1. POScrollView doesn't scrolls if soft keyboard is visible
    text
    copied!<p>I'm using a simple layout for a login screen which contains a bar at the top and the necessary items for user to login or go to the sign up activity.</p> <p>All the elements fit nicely on the screen until the virtual keyboard appears. The Android soft keyboard obscures part of the form, and I want to use a ScrollView so the user can scroll and be able to see all the elements.</p> <p>But, even with ScrollView, I can't scroll to see the bottom of the page:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillViewport="true" &gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFCB05" android:orientation="vertical" android:isScrollContainer="true" android:gravity="top" &gt; &lt;include android:id="@+id/include1" android:layout_width="fill_parent" android:layout_height="50dip" layout="@layout/actionbar_layout" /&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFFFFF" android:orientation="vertical" android:gravity="center_vertical" android:layout_below="@+id/include1" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:text="@string/usuario" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="#000000" /&gt; &lt;EditText android:id="@+id/txtUsuario" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/textView1" android:layout_marginTop="5dp" android:ems="10" android:hint="@string/usuario" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_marginTop="15dip" &gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:text="@string/senha" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="#000000" /&gt; &lt;EditText android:id="@+id/txtSenha" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/textView2" android:layout_centerVertical="true" android:layout_marginTop="5dip" android:ems="10" android:hint="@string/senha" android:inputType="textPassword" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:gravity="right" &gt; &lt;Button android:id="@+id/logarBtn" android:layout_width="93dp" android:layout_height="wrap_content" android:layout_marginRight="30dip" android:layout_marginTop="15dip" android:layout_marginBottom="15dip" android:text="@string/logar" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:gravity="center_horizontal" &gt; &lt;TextView android:id="@+id/registerBtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/logarBtn" android:layout_centerHorizontal="true" android:layout_marginTop="20dip" android:layout_marginBottom="60dip" android:linksClickable="true" android:text="@string/cadastrar" android:textColor="#0000CC" android:textSize="18dp" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>I think I could do this: <a href="https://stackoverflow.com/questions/10388326/android-soft-keyboard-obscures-edittexts-in-scrollview">Android Soft Keyboard Obscures EditTexts in ScrollView</a> but it doesn't seem like the best practice. </p> <p>Does anyone know of a better way to make it scroll properly?</p>
 

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