I have a scrollview with a relative layout inside of it. When I have the relative layout height set to match_parent it does this to the graphical layout and I do not know why it's doing this. ---PICTURE BELOW---
Here is the activity_main.xml file:
<ScrollView 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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="@+id/etName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:ems="10"
android:hint="First and Last Name"
android:inputType="textPersonName" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/etPhone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/etName"
android:layout_marginTop="14dp"
android:ems="10"
android:hint="Enter Phone #"
android:inputType="phone" />
<EditText
android:id="@+id/etEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/etPhone"
android:layout_marginTop="17dp"
android:ems="10"
android:hint="Enter E-mail"
android:inputType="textEmailAddress" />
<EditText
android:id="@+id/etAdd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/etEmail"
android:layout_marginTop="18dp"
android:ems="10"
android:hint="Additional Information"
android:lines="5"
android:inputType="textMultiLine" />
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/etPhone"
android:layout_alignParentTop="true"
android:gravity="center"
android:text="Contact Form"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/send"
android:layout_width="match_parent"
android:layout_height="125dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Send" />
</RelativeLayout>
</ScrollView>
I have also tried to set the scroll view width and height to fill_parent and it still does the same thing. What am I doing wrong?
Thank you in advance!
You haven't specified the correct positioning of Button
Add android:layout_below="@+id/etAdd"
to your button
<Button
android:id="@+id/send"
android:layout_width="match_parent"
android:layout_height="125dp"
android:layout_below="@+id/etAdd"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Send" />
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments