Sunday, 1 February 2015

Scrollview not displaying all elements of a Relative Layout



Hi guys I'm very new to the android world and I've been having a problem with a ScrollView in my android application. The problem occurs when I change the orientation of the screen from portrait to landscape and the Sign in button is not displayed. It could be the due to the sign up button being displayed at the end of the layout. Any help would be appreciated.


The login_layout.xml is as follows:



<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://ift.tt/nIICcg"
android:scrollbars="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:layout_weight="1">

<RelativeLayout
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#ff2b8bff">

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sign in"
android:id="@+id/signInButton"
android:background="#fffffbfd"
android:onClick="signIn"
android:layout_below="@+id/usersPassword"
android:layout_centerHorizontal="true"
android:layout_marginTop="52dp" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="@+id/usersEmail"
android:layout_marginTop="31dp"
android:layout_below="@+id/bourguestLogo"
android:layout_centerHorizontal="true" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/usersPassword"
android:layout_marginTop="35dp"
android:layout_below="@+id/usersEmail"
android:layout_alignStart="@+id/usersEmail" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sign up"
android:id="@+id/signUpButton"
android:onClick="changeLayout"
android:background="#ffff2f14"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bourguestLogo"
android:src="@drawable/waiter"
android:layout_marginTop="88dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />

</RelativeLayout>
</ScrollView>

No comments:

Post a Comment