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

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -