android - Issue with layout inside scroll view -


i have layout:

<scrollview     android:layout_width="match_parent"     android:layout_height="match_parent">      <relativelayout         android:layout_width="match_parent"         android:layout_height="match_parent">          <edittext             android:id="@+id/username_edittext"             android:layout_width="match_parent"             android:layout_height="55dp"             android:background="@android:color/white"             android:gravity="center"             android:hint="@string/username"             android:textcolor="@color/dark_grey" />          <edittext             android:id="@+id/password_edittext"             android:layout_width="match_parent"             android:layout_height="55dp"             android:layout_below="@id/username_edittext"             android:background="@android:color/white"             android:gravity="center"             android:hint="@string/password"             android:textcolor="@color/dark_grey" />          <button             android:id="@+id/login_button"             style="@style/buttonstyle"             android:layout_width="match_parent"             android:layout_height="55dp"             android:layout_alignparentbottom="true"             android:layout_below="@id/password_edittext"             android:text="@string/login" />      </relativelayout>  </scrollview> 

and shown as:

enter image description here

but want align button "entrar" (login_button) @ bottom of screen. relativelayout not filling parent (scrollview) alignparentbottom = true in button not working properly.

what can do?

thanks.

solved! have added android:fillviewport="true" in scrollview , removed android:layout_below="@id/password_edittext" button.

<scrollview     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fillviewport="true">      <relativelayout         android:layout_width="match_parent"         android:layout_height="match_parent">          <edittext             android:id="@+id/username_edittext"             android:layout_width="match_parent"             android:layout_height="55dp"             android:background="@android:color/white"             android:gravity="center"             android:hint="@string/username"             android:textcolor="@color/dark_grey" />          <edittext             android:id="@+id/password_edittext"             android:layout_width="match_parent"             android:layout_height="55dp"             android:layout_below="@id/username_edittext"             android:background="@android:color/white"             android:gravity="center"             android:hint="@string/password"             android:textcolor="@color/dark_grey" />          <button             android:id="@+id/login_button"             style="@style/buttonstyle"             android:layout_width="match_parent"             android:layout_height="55dp"             android:layout_alignparentbottom="true"             android:text="@string/login" />      </relativelayout>  </scrollview> 

enter image description here


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -