I have a relative Layout inside a scroll view. I am adding text views as you can see in the picture. Now the problem is when the space is full and I am adding the button at the bottom, it is not showing properly. How can I see the button and the other content at the bottom ? Here is the xml file of my picture.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
android:background="#436dbf"
tools:context="com.kamranchaudhary.pucitportal.Aggreagte">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:scrollbarStyle="insideOverlay"
android:scrollbarThumbVertical="#drawable/custom_bar"
android:layout_alignParentBottom="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Pucit Aggregate Calculator"
android:id="#+id/textView5"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textColor="#ffffff" />
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:layout_below="#+id/textView5"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:id="#+id/view" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Matric"
android:id="#+id/textView6"
android:layout_below="#+id/view"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView7"
android:textColor="#ffffff"
android:layout_below="#+id/textView6"
android:layout_alignStart="#+id/view"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView8"
android:layout_below="#+id/textView7"
android:layout_alignStart="#+id/textView7"
android:textColor="#ffffff"
android:layout_marginTop="10dp" />
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:id="#+id/view2"
android:layout_below="#+id/textView8"
android:layout_alignStart="#+id/textView8"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Intermediate"
android:id="#+id/textView9"
android:layout_below="#+id/view2"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView10"
android:layout_below="#+id/textView9"
android:layout_alignStart="#+id/view2"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView11"
android:textColor="#ffffff"
android:layout_below="#+id/textView10"
android:layout_alignStart="#+id/textView10"
android:layout_marginTop="10dp"/>
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:id="#+id/view3"
android:layout_below="#+id/textView11"
android:layout_alignStart="#+id/textView11"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="PUCIT Entry Test"
android:id="#+id/textView12"
android:layout_below="#+id/view3"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView13"
android:layout_below="#+id/textView12"
android:layout_alignStart="#+id/view3"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView14"
android:layout_below="#+id/textView13"
android:layout_alignStart="#+id/textView13"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:layout_below="#+id/textView14"
android:layout_alignStart="#+id/textView14"
android:layout_marginTop="10dp"
android:id="#+id/view4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Extras"
android:id="#+id/textView15"
android:layout_below="#+id/view4"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Are You Hafiz e Quran ?"
android:id="#+id/textView16"
android:layout_below="#+id/textView15"
android:layout_alignStart="#+id/view4"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Intermediate passing Year"
android:id="#+id/textView17"
android:layout_below="#+id/textView16"
android:layout_alignStart="#+id/textView16"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/checkBox"
android:checked="false"
android:layout_alignTop="#+id/textView16"
android:layout_alignEnd="#+id/textView5" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/spinner"
android:layout_below="#+id/textView16"
android:layout_alignParentEnd="true"
android:layout_marginTop="13dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="#+id/button4"
android:layout_below="#+id/textView17"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</ScrollView>
It seems you are not using ScrollView correctly.
<?xml version="1.0" encoding="utf-8"?>
<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:scrollbarStyle="insideOverlay"
android:scrollbarThumbVertical="#drawable/custom_bar"
tools:context="com.kamranchaudhary.pucitportal.Aggreagte">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Pucit Aggregate Calculator"
android:id="#+id/textView5"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textColor="#ffffff" />
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:layout_below="#+id/textView5"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:id="#+id/view" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Matric"
android:id="#+id/textView6"
android:layout_below="#+id/view"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView7"
android:textColor="#ffffff"
android:layout_below="#+id/textView6"
android:layout_alignStart="#+id/view"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView8"
android:layout_below="#+id/textView7"
android:layout_alignStart="#+id/textView7"
android:textColor="#ffffff"
android:layout_marginTop="10dp" />
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:id="#+id/view2"
android:layout_below="#+id/textView8"
android:layout_alignStart="#+id/textView8"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Intermediate"
android:id="#+id/textView9"
android:layout_below="#+id/view2"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView10"
android:layout_below="#+id/textView9"
android:layout_alignStart="#+id/view2"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView11"
android:textColor="#ffffff"
android:layout_below="#+id/textView10"
android:layout_alignStart="#+id/textView10"
android:layout_marginTop="10dp"/>
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:id="#+id/view3"
android:layout_below="#+id/textView11"
android:layout_alignStart="#+id/textView11"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="PUCIT Entry Test"
android:id="#+id/textView12"
android:layout_below="#+id/view3"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView13"
android:layout_below="#+id/textView12"
android:layout_alignStart="#+id/view3"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView14"
android:layout_below="#+id/textView13"
android:layout_alignStart="#+id/textView13"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:layout_below="#+id/textView14"
android:layout_alignStart="#+id/textView14"
android:layout_marginTop="10dp"
android:id="#+id/view4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Extras"
android:id="#+id/textView15"
android:layout_below="#+id/view4"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Are You Hafiz e Quran ?"
android:id="#+id/textView16"
android:layout_below="#+id/textView15"
android:layout_alignStart="#+id/view4"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Intermediate passing Year"
android:id="#+id/textView17"
android:layout_below="#+id/textView16"
android:layout_alignStart="#+id/textView16"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/checkBox"
android:checked="false"
android:layout_alignTop="#+id/textView16"
android:layout_alignEnd="#+id/textView5" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/spinner"
android:layout_below="#+id/textView16"
android:layout_alignParentEnd="true"
android:layout_marginTop="13dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="#+id/button4"
android:layout_below="#+id/textView17"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</ScrollView>
or try closing Parent RelativeLayout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
android:background="#436dbf"
tools:context="com.kamranchaudhary.pucitportal.Aggreagte">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:scrollbarStyle="insideOverlay"
android:scrollbarThumbVertical="#drawable/custom_bar"
android:layout_alignParentBottom="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Pucit Aggregate Calculator"
android:id="#+id/textView5"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textColor="#ffffff" />
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:layout_below="#+id/textView5"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:id="#+id/view" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Matric"
android:id="#+id/textView6"
android:layout_below="#+id/view"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView7"
android:textColor="#ffffff"
android:layout_below="#+id/textView6"
android:layout_alignStart="#+id/view"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView8"
android:layout_below="#+id/textView7"
android:layout_alignStart="#+id/textView7"
android:textColor="#ffffff"
android:layout_marginTop="10dp" />
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:id="#+id/view2"
android:layout_below="#+id/textView8"
android:layout_alignStart="#+id/textView8"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Intermediate"
android:id="#+id/textView9"
android:layout_below="#+id/view2"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView10"
android:layout_below="#+id/textView9"
android:layout_alignStart="#+id/view2"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView11"
android:textColor="#ffffff"
android:layout_below="#+id/textView10"
android:layout_alignStart="#+id/textView10"
android:layout_marginTop="10dp"/>
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:id="#+id/view3"
android:layout_below="#+id/textView11"
android:layout_alignStart="#+id/textView11"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="PUCIT Entry Test"
android:id="#+id/textView12"
android:layout_below="#+id/view3"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Obtained Marks"
android:id="#+id/textView13"
android:layout_below="#+id/textView12"
android:layout_alignStart="#+id/view3"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Total Marks"
android:id="#+id/textView14"
android:layout_below="#+id/textView13"
android:layout_alignStart="#+id/textView13"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<View
android:layout_width="300dp"
android:layout_height="1dip"
android:background="#ffffff"
android:layout_below="#+id/textView14"
android:layout_alignStart="#+id/textView14"
android:layout_marginTop="10dp"
android:id="#+id/view4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Extras"
android:id="#+id/textView15"
android:layout_below="#+id/view4"
android:layout_alignParentStart="true"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Are You Hafiz e Quran ?"
android:id="#+id/textView16"
android:layout_below="#+id/textView15"
android:layout_alignStart="#+id/view4"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Intermediate passing Year"
android:id="#+id/textView17"
android:layout_below="#+id/textView16"
android:layout_alignStart="#+id/textView16"
android:textColor="#ffffff"
android:layout_marginTop="10dp"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/checkBox"
android:checked="false"
android:layout_alignTop="#+id/textView16"
android:layout_alignEnd="#+id/textView5" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/spinner"
android:layout_below="#+id/textView16"
android:layout_alignParentEnd="true"
android:layout_marginTop="13dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="#+id/button4"
android:layout_below="#+id/textView17"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
Related
I was trying to find a way to scroll my Relative Layout while I'm in designer in Intellij, since I can't see all the elements I want and position them right. I researched and read numerous threads and the advice I saw most was "wrap the layout you want to scroll in ScrollView", which I did, but that didn't help me. I still can't see all of my widgets and when I put them near the end of the screen, they either shrink or get positioned below - where I can't see them and manage them. I'm new to all this, so I guess I must be doing something wrong.
I apologize in advance if the answer to this question already exists, I couldn't find it
Here's my XML :
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/ScrollView02"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:nestedScrollingEnabled="true"
android:scrollIndicators="right"
tools:scrollY="150px" android:addStatesFromChildren="true" android:isScrollContainer="true"
android:scrollbarAlwaysDrawHorizontalTrack="false" android:scrollY="300dp">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButton3"
android:layout_alignParentTop="true" android:layout_alignParentStart="false"
android:layout_alignParentEnd="true" android:background="#drawable/abc_ic_menu_overflow_material"
android:clickable="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TITLE"
android:id="#+id/textView7" android:layout_below="#+id/imageButton3"
android:layout_centerHorizontal="true" android:textSize="25dp" android:textStyle="bold"/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/spinner"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:layout_above="#+id/textView9" android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"/>
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/seekBar"
android:layout_alignBottom="#+id/weight_button" android:layout_toEndOf="#+id/weight_button"
android:layout_marginBottom="12dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="First"
android:id="#+id/textView9"
android:layout_above="#+id/textView10" android:layout_alignStart="#+id/spinner"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="< >"
android:id="#+id/textView10"
android:textStyle="bold"
android:textSize="20dp"
android:layout_above="#+id/seekBar" android:layout_toStartOf="#+id/imageButton3"/>
<Button
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/weight_button"
android:text="80"
android:allowUndo="true"
android:background="#drawable/round_button_weight"
android:layout_marginLeft="5dp" android:textColor="#android:color/white"
android:layout_above="#+id/textView11" android:layout_alignStart="#+id/textView9"
android:layout_marginBottom="17dp"/>
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/weight_button"
android:layout_alignEnd="#+id/imageButton3" android:id="#+id/linearLayout2"
android:layout_marginTop="10dp" android:layout_alignLeft="#+id/weight_button">
</LinearLayout>
<TextView android:layout_width="match_parent" android:layout_height="1dp" android:id="#+id/textView11"
android:background="#555252" android:layout_weight="1" android:layout_gravity="center_vertical"
android:layout_alignParentStart="true" android:layout_marginBottom="10dp"
android:layout_above="#+id/textView12"/>
<SeekBar android:layout_width="match_parent" android:layout_height="wrap_content" android:id="#+id/seekBar2"
android:layout_centerVertical="true" android:layout_toEndOf="#+id/button"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Second"
android:id="#+id/textView12"
android:layout_above="#+id/button" android:layout_alignStart="#+id/textView9"
android:layout_marginBottom="5dp" android:layout_marginTop="10dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="< >"
android:id="#+id/textView13" android:textStyle="bold" android:textSize="20dp"
android:layout_below="#+id/textView12" android:layout_alignEnd="#+id/spinner"/>
<Button android:layout_width="50dp" android:layout_height="50dp" android:id="#+id/button" android:text="175"
android:allowUndo="true" android:background="#drawable/round_button_height"
android:textColor="#android:color/white"
android:layout_centerVertical="true" android:layout_toStartOf="#+id/seekBar"/>
<TextView android:layout_width="match_parent" android:layout_height="1dp" android:id="#+id/textView14"
android:background="#555252" android:layout_weight="1" android:layout_gravity="center_vertical"
android:layout_below="#+id/button" android:layout_alignLeft="#+id/textView11"
android:layout_marginTop="10dp" android:layout_marginBottom="5dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Third"
android:id="#+id/textView15"
android:layout_below="#+id/textView14" android:layout_alignStart="#+id/button2"
android:layout_marginBottom="5dp" android:layout_marginTop="10dp"/>
<Button android:layout_width="50dp" android:layout_height="50dp" android:id="#+id/button2" android:text="24"
android:allowUndo="true" android:background="#drawable/round_button_height"
android:textColor="#android:color/white"
android:layout_alignTop="#+id/textView16" android:layout_toStartOf="#+id/seekBar3"
android:layout_marginBottom="20dp"/>
<SeekBar android:layout_width="match_parent" android:layout_height="wrap_content" android:id="#+id/seekBar3"
android:layout_alignBottom="#+id/button2" android:layout_alignStart="#+id/seekBar2"
android:layout_marginBottom="12dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="< >"
android:id="#+id/textView16" android:textStyle="bold" android:textSize="20dp"
android:layout_below="#+id/textView15"
android:layout_alignRight="#+id/textView10" android:layout_alignLeft="#+id/textView10"/>
<TextView android:layout_width="match_parent" android:layout_height="1dp" android:id="#+id/textView17"
android:background="#555252" android:layout_weight="1" android:layout_gravity="center_vertical"
android:layout_below="#+id/button2"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0-6"
android:id="#+id/radioButton1"
android:layout_marginTop="37dp" android:checked="false"
android:layout_below="#+id/textView17" android:layout_alignEnd="#+id/textView9"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6-18"
android:id="#+id/radioButton2"
android:checked="false"
android:layout_alignTop="#+id/radioButton3" android:layout_centerHorizontal="true"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">18"
android:id="#+id/radioButton3"
android:checked="false"
android:layout_alignTop="#+id/radioButton1" android:layout_alignEnd="#+id/textView16"
android:layout_marginEnd="26dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Title1"
android:id="#+id/textView18"
android:textStyle="bold"
android:textSize="15dp" android:layout_above="#+id/radioButton2" android:layout_alignParentStart="false"
android:padding="10dp" android:textAllCaps="true" android:textColor="#android:color/white"
android:background="#3b3c50" android:layout_marginTop="20dp" android:layout_marginBottom="10dp"/>
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="Title2" android:id="#+id/textView19"
android:textStyle="bold"
android:textSize="15dp" android:layout_below="#+id/radioButton1"
android:layout_alignStart="#+id/textView18" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" android:padding="10dp" android:textAllCaps="true"
android:textColor="#android:color/white" android:background="#3b3c50"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1"
android:id="#+id/radioButton" android:checked="false"
android:layout_below="#+id/textView19" android:layout_alignStart="#+id/radioButton1"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2"
android:id="#+id/radioButton4" android:checked="false"
android:layout_below="#+id/textView19" android:layout_alignEnd="#+id/textView7"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3"
android:id="#+id/radioButton5" android:checked="false"
android:layout_alignTop="#+id/radioButton4" android:layout_alignEnd="#+id/textView13"/>
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Title 3"
android:id="#+id/textView20" android:textStyle="bold" android:textSize="15dp"
android:layout_below="#+id/radioButton" android:layout_alignStart="#+id/textView19"
android:layout_marginTop="10dp" android:layout_marginBottom="10dp"
android:textColor="#android:color/white" android:background="#3b3c50" android:textAllCaps="true"
android:padding="10dp"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1"
android:id="#+id/radioButton6" android:checked="false"
android:layout_below="#+id/textView20" android:layout_alignStart="#+id/radioButton"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2"
android:id="#+id/radioButton7" android:checked="false"
android:layout_alignTop="#+id/radioButton6" android:layout_alignStart="#+id/radioButton4"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3"
android:id="#+id/radioButton8" android:checked="false"
android:layout_alignTop="#+id/radioButton7" android:layout_alignStart="#+id/radioButton5"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Title4"
android:id="#+id/textView21" android:textStyle="bold" android:textSize="15dp"
android:layout_below="#+id/radioButton8" android:layout_alignStart="#+id/textView20"
android:layout_marginTop="10dp" android:layout_marginBottom="10dp"/>
</RelativeLayout>
</ScrollView>
You can add LinearLayout under ScrollView and then put RelativeLayout under LinearLayout.
Try this i have edited your layout file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/ScrollView02"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:addStatesFromChildren="true"
android:fillViewport="true"
android:isScrollContainer="true"
android:nestedScrollingEnabled="true"
android:scrollIndicators="right"
android:scrollbarAlwaysDrawHorizontalTrack="false"
tools:scrollY="150px">
<RelativeLayout
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">
<ImageButton
android:id="#+id/imageButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:background="#drawable/abc_ic_menu_overflow_material"
android:clickable="true" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageButton3"
android:layout_centerHorizontal="true"
android:text="TITLE"
android:textSize="25dp"
android:textStyle="bold" />
<Spinner
android:id="#+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView9"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" />
<SeekBar
android:id="#+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/weight_button"
android:layout_marginBottom="12dp"
android:layout_toRightOf="#+id/weight_button"
android:layout_toEndOf="#+id/weight_button" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView10"
android:layout_alignLeft="#+id/spinner"
android:layout_alignStart="#+id/spinner"
android:text="First" />
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/seekBar"
android:layout_toLeftOf="#+id/imageButton3"
android:layout_toStartOf="#+id/imageButton3"
android:text="< >"
android:textSize="20dp"
android:textStyle="bold" />
<Button
android:id="#+id/weight_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_above="#+id/textView11"
android:layout_alignLeft="#+id/textView9"
android:layout_alignStart="#+id/textView9"
android:layout_marginBottom="17dp"
android:layout_marginLeft="5dp"
android:allowUndo="true"
android:background="#drawable/round_button_weight"
android:text="80"
android:textColor="#android:color/white" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/imageButton3"
android:layout_alignRight="#+id/imageButton3"
android:layout_alignLeft="#+id/weight_button"
android:layout_below="#+id/weight_button"
android:layout_marginTop="10dp"
android:orientation="horizontal"></LinearLayout>
<TextView
android:id="#+id/textView11"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="#+id/textView12"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_gravity="center_vertical"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="#555252" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/button"
android:layout_toRightOf="#+id/button" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button"
android:layout_alignStart="#+id/textView9"
android:layout_alignLeft="#+id/textView9"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:text="Second" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/spinner"
android:layout_alignRight="#+id/spinner"
android:layout_below="#+id/textView12"
android:text="< >"
android:textSize="20dp"
android:textStyle="bold" />
<Button
android:id="#+id/button"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_toStartOf="#+id/seekBar"
android:layout_toLeftOf="#+id/seekBar"
android:allowUndo="true"
android:background="#drawable/round_button_height"
android:text="175"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/textView14"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignLeft="#+id/textView11"
android:layout_below="#+id/button"
android:layout_gravity="center_vertical"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:background="#555252" />
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/button2"
android:layout_alignLeft="#+id/button2"
android:layout_below="#+id/textView14"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:text="Third" />
<Button
android:id="#+id/button2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignTop="#+id/textView16"
android:layout_marginBottom="20dp"
android:layout_toStartOf="#+id/seekBar3"
android:layout_toLeftOf="#+id/seekBar3"
android:allowUndo="true"
android:background="#drawable/round_button_height"
android:text="24"
android:textColor="#android:color/white" />
<SeekBar
android:id="#+id/seekBar3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/button2"
android:layout_alignStart="#+id/seekBar2"
android:layout_alignLeft="#+id/seekBar2"
android:layout_marginBottom="12dp" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView10"
android:layout_alignRight="#+id/textView10"
android:layout_below="#+id/textView15"
android:text="< >"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView17"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/button2"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="#555252" />
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/textView9"
android:layout_alignRight="#+id/textView9"
android:layout_below="#+id/textView17"
android:layout_marginTop="37dp"
android:checked="false"
android:text="0-6" />
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/radioButton3"
android:layout_centerHorizontal="true"
android:checked="false"
android:text="6-18" />
<RadioButton
android:id="#+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/textView16"
android:layout_alignRight="#+id/textView16"
android:layout_alignTop="#+id/radioButton1"
android:layout_marginEnd="26dp"
android:layout_marginRight="26dp"
android:checked="false"
android:text=">18" />
<TextView
android:id="#+id/textView18"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/radioButton2"
android:layout_alignParentStart="false"
android:layout_alignParentLeft="false"
android:layout_marginBottom="10dp"
android:layout_marginTop="20dp"
android:background="#3b3c50"
android:padding="10dp"
android:text="Title1"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView19"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/textView18"
android:layout_alignLeft="#+id/textView18"
android:layout_below="#+id/radioButton1"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="#3b3c50"
android:padding="10dp"
android:text="Title2"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="15dp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/radioButton1"
android:layout_alignLeft="#+id/radioButton1"
android:layout_below="#+id/textView19"
android:checked="false"
android:text="1" />
<RadioButton
android:id="#+id/radioButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/textView7"
android:layout_alignRight="#+id/textView7"
android:layout_below="#+id/textView19"
android:checked="false"
android:text="2" />
<RadioButton
android:id="#+id/radioButton5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/textView13"
android:layout_alignRight="#+id/textView13"
android:layout_alignTop="#+id/radioButton4"
android:checked="false"
android:text="3" />
<TextView
android:id="#+id/textView20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/textView19"
android:layout_alignLeft="#+id/textView19"
android:layout_below="#+id/radioButton"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="#3b3c50"
android:padding="10dp"
android:text="Title 3"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="15dp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/radioButton6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/radioButton"
android:layout_alignLeft="#+id/radioButton"
android:layout_below="#+id/textView20"
android:checked="false"
android:text="1" />
<RadioButton
android:id="#+id/radioButton7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/radioButton4"
android:layout_alignLeft="#+id/radioButton4"
android:layout_alignTop="#+id/radioButton6"
android:checked="false"
android:text="2" />
<RadioButton
android:id="#+id/radioButton8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/radioButton5"
android:layout_alignLeft="#+id/radioButton5"
android:layout_alignTop="#+id/radioButton7"
android:checked="false"
android:text="3" />
<TextView
android:id="#+id/textView21"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/textView20"
android:layout_alignLeft="#+id/textView20"
android:layout_below="#+id/radioButton8"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Title4"
android:textSize="15dp"
android:textStyle="bold" />
</RelativeLayout>
Thank you for your suggestions, but neither of them did help. After I updated IntelliJ to 3.x version, it worked, without changing the code.
I tried to display the code in android studio and got this error:
Exception raised during rendering: Circular dependencies cannot exist in RelativeLayout.
I tried changing the code in many spots but nothing seemed to help.....
In the layout i was trying to make a line of text boxes and two parallel lines of TextView. I would like to keep this design so that it stays that way. so if someone has an answer that keeps it in place and fixes the problem i would be very great-full if he posted it.
this is my code:
<TextView
android:text="#string/added"
android:textSize="45sp"
android:id="#+id/welcome_name4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView5"
android:textColor="#000"
android:layout_below="#+id/welcome_name4"
android:layout_alignLeft="#+id/textView6"
android:layout_alignStart="#+id/textView6" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView6"
android:textColor="#000"
android:layout_below="#+id/textView5"
android:layout_alignLeft="#+id/textView7"
android:layout_alignStart="#+id/textView7" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView7"
android:textColor="#000"
android:layout_below="#+id/textView6"
android:layout_alignLeft="#+id/textView8"
android:layout_alignStart="#+id/textView8" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView8"
android:textColor="#000"
android:layout_above="#+id/textView7"
android:layout_alignLeft="#+id/textView9"
android:layout_alignStart="#+id/textView9" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView9"
android:textColor="#000"
android:layout_alignTop="#+id/textView8"
android:layout_alignLeft="#+id/textView10"
android:layout_alignStart="#+id/textView10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView10"
android:textColor="#000"
android:layout_below="#+id/textView9"
android:layout_alignLeft="#+id/textView11"
android:layout_alignStart="#+id/textView11" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView11"
android:textColor="#000"
android:layout_below="#+id/textView10"
android:layout_alignLeft="#+id/textView12"
android:layout_alignStart="#+id/textView12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView12"
android:textColor="#000"
android:layout_alignTop="#+id/textView32"
android:layout_alignLeft="#+id/textView13"
android:layout_alignStart="#+id/textView13" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView13"
android:textColor="#000"
android:layout_below="#+id/textView12"
android:layout_alignLeft="#+id/textView10"
android:layout_alignStart="#+id/textView10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView14"
android:textColor="#000"
android:layout_below="#+id/textView13"
android:layout_alignLeft="#+id/textView13"
android:layout_alignStart="#+id/textView13" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView15"
android:textColor="#000"
android:layout_below="#+id/textView14"
android:layout_alignStart="#+id/textView16"
android:layout_alignLeft="#+id/textView16"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView16"
android:textColor="#000"
android:layout_below="#+id/textView15"
android:layout_toLeftOf="#+id/cb11"
android:layout_toStartOf="#+id/cb11" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView17"
android:textColor="#000"
android:layout_above="#+id/textView18"
android:layout_alignStart="#+id/textView15"
android:layout_alignLeft="#+id/textView15"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView18"
android:textColor="#000"
android:layout_alignTop="#+id/textView38"
android:layout_alignLeft="#+id/textView17"
android:layout_alignStart="#+id/textView17" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView19"
android:textColor="#000"
android:layout_below="#+id/textView18"
android:layout_alignLeft="#+id/textView18"
android:layout_alignStart="#+id/textView18" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView20"
android:textColor="#000"
android:layout_below="#+id/textView19"
android:layout_alignLeft="#+id/textView19"
android:layout_alignStart="#+id/textView19" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView21"
android:textColor="#000"
android:layout_below="#+id/textView20"
android:layout_alignLeft="#+id/textView18"
android:layout_alignStart="#+id/textView18" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView22"
android:textColor="#000"
android:layout_below="#+id/textView21"
android:layout_alignLeft="#+id/textView21"
android:layout_alignStart="#+id/textView21" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView23"
android:textColor="#000"
android:layout_alignTop="#+id/textView43"
android:layout_alignLeft="#+id/textView24"
android:layout_alignStart="#+id/textView24" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView24"
android:textColor="#000"
android:layout_alignTop="#+id/textView23"
android:layout_alignLeft="#+id/textView22"
android:layout_alignStart="#+id/textView22" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView25"
android:layout_above="#+id/textView6"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView26"
android:layout_below="#+id/textView25"
android:layout_alignRight="#+id/welcome_name4"
android:layout_alignEnd="#+id/welcome_name4" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView27"
android:layout_below="#+id/textView26"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView28"
android:layout_below="#+id/textView27"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView29"
android:layout_below="#+id/textView28"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView30"
android:layout_below="#+id/textView29"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView31"
android:layout_below="#+id/textView30"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView32"
android:layout_below="#+id/textView31"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView33"
android:layout_below="#+id/textView32"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView34"
android:layout_below="#+id/textView33"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView35"
android:layout_below="#+id/textView34"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView36"
android:layout_below="#+id/textView35"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView37"
android:layout_below="#+id/textView36"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView38"
android:layout_below="#+id/textView37"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView39"
android:layout_below="#+id/textView38"
android:layout_alignRight="#+id/welcome_name4"
android:layout_alignEnd="#+id/welcome_name4" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView40"
android:layout_alignTop="#+id/textView20"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView41"
android:layout_below="#+id/textView40"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView42"
android:layout_below="#+id/textView41"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView43"
android:layout_below="#+id/textView42"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:id="#+id/textView44"
android:layout_below="#+id/textView43"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:textColor="#000"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:onClick="deleteMember"
android:id="#+id/cb1"
android:tag="1"
android:layout_above="#+id/textView6"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/welcome_name4" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:onClick="deleteMember"
android:id="#+id/cb2"
android:tag="2"
android:layout_below="#+id/textView5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="#+id/textView6" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="3"
android:onClick="deleteMember"
android:id="#+id/cb3"
android:layout_alignTop="#+id/textView7"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView8" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="4"
android:onClick="deleteMember"
android:id="#+id/cb4"
android:layout_below="#+id/cb3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="#+id/textView8" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="5"
android:onClick="deleteMember"
android:id="#+id/cb5"
android:layout_alignTop="#+id/textView9"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView10" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="6"
android:onClick="deleteMember"
android:id="#+id/cb6"
android:layout_below="#+id/cb5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView11" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="7"
android:onClick="deleteMember"
android:id="#+id/cb7"
android:layout_below="#+id/textView10"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="#+id/textView11" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="deleteMember"
android:tag="8"
android:id="#+id/cb8"
android:layout_alignTop="#+id/textView12"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView13"
android:checked="false" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="9"
android:onClick="deleteMember"
android:id="#+id/cb9"
android:layout_below="#+id/textView12"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView14" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="10"
android:onClick="deleteMember"
android:id="#+id/cb10"
android:layout_below="#+id/textView13"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="#+id/textView14" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="11"
android:onClick="deleteMember"
android:id="#+id/cb11"
android:layout_below="#+id/cb10"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView16" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="12"
android:onClick="deleteMember"
android:id="#+id/cb12"
android:layout_below="#+id/cb11"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView17" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="13"
android:onClick="deleteMember"
android:id="#+id/cb13"
android:layout_below="#+id/textView16"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="#+id/textView17" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="14"
android:onClick="deleteMember"
android:id="#+id/cb14"
android:layout_alignTop="#+id/textView18"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView19" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="15"
android:onClick="deleteMember"
android:id="#+id/cb15"
android:layout_below="#+id/textView18"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView20" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="16"
android:onClick="deleteMember"
android:id="#+id/cb16"
android:layout_below="#+id/textView19"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView21" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="17"
android:onClick="deleteMember"
android:id="#+id/cb17"
android:layout_below="#+id/textView20"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_above="#+id/textView22" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="18"
android:onClick="deleteMember"
android:id="#+id/cb18"
android:layout_below="#+id/textView21"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="#+id/textView22" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="19"
android:onClick="deleteMember"
android:id="#+id/cb19"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/textView22"
android:layout_alignBottom="#+id/textView23" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:tag="20"
android:onClick="deleteMember"
android:id="#+id/cb20"
android:layout_below="#+id/textView23"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignBottom="#+id/textView44" />
Thanks a lot for helping:)
Your Views are referring to each other in a bidirectional way, which causes the circular dependency that you should not have.
For example: textView5's position in the layout is based on textView6's position, but textView6's position is also based on textView5's position. This dependency should be only one-way.
I m using android studio 1.0.... In design ,my screen is get filled and when it runs it needs to scroll down but its not ... I tried previous answers an add scroll view in layout but there is error ( Scroll view can host only one child) enter code here
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/ScrollView">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="INTRODUCTION:"
android:id="#+id/heading1"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textAlignment="center"
android:phoneNumber="false"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/Introduction"
android:id="#+id/textView2"
android:layout_below="#+id/heading1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="HYDROCARBON:"
android:id="#+id/textView3"
android:layout_below="#+id/textView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/hydrocarbon"
android:id="#+id/textView4"
android:layout_below="#+id/textView3"
android:layout_alignLeft="#+id/textView2"
android:layout_alignStart="#+id/textView2" />
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:id="#+id/imageView"
android:layout_below="#+id/textView4"
android:layout_centerHorizontal="true"
android:src="#drawable/ethane"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="TYPES OF HYDROCARBON:"
android:id="#+id/textView5"
android:layout_below="#+id/imageView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/types"
android:id="#+id/textView6"
android:layout_below="#+id/textView5"
android:layout_alignLeft="#+id/textView4"
android:layout_alignStart="#+id/textView4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Alkane"
android:id="#+id/textView7"
android:layout_below="#+id/textView6"
android:layout_alignLeft="#+id/textView6"
android:layout_alignStart="#+id/textView6" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Alkene"
android:id="#+id/textView8"
android:layout_below="#+id/textView7"
android:layout_alignLeft="#+id/textView7"
android:layout_alignStart="#+id/textView7" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Alkyne"
android:id="#+id/textView9"
android:layout_below="#+id/textView8"
android:layout_alignLeft="#+id/textView8"
android:layout_alignStart="#+id/textView8" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BACK"
android:id="#+id/button2"
android:onClick="mainPage"
android:layout_below="#+id/textView9"
android:layout_alignRight="#+id/textView8"
android:layout_alignEnd="#+id/textView8" />
This should help
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="#+id/ScrollView">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/RelativeLayout">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="INTRODUCTION:"
android:id="#+id/heading1"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textAlignment="center"
android:phoneNumber="false"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/Introduction"
android:id="#+id/textView2"
android:layout_below="#+id/heading1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="HYDROCARBON:"
android:id="#+id/textView3"
android:layout_below="#+id/textView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/hydrocarbon"
android:id="#+id/textView4"
android:layout_below="#+id/textView3"
android:layout_alignLeft="#+id/textView2"
android:layout_alignStart="#+id/textView2" />
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:id="#+id/imageView"
android:layout_below="#+id/textView4"
android:layout_centerHorizontal="true"
android:src="#drawable/ethane" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="TYPES OF HYDROCARBON:"
android:id="#+id/textView5"
android:layout_below="#+id/imageView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/types"
android:id="#+id/textView6"
android:layout_below="#+id/textView5"
android:layout_alignLeft="#+id/textView4"
android:layout_alignStart="#+id/textView4" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Alkane"
android:id="#+id/textView7"
android:layout_below="#+id/textView6"
android:layout_alignLeft="#+id/textView6"
android:layout_alignStart="#+id/textView6" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Alkene"
android:id="#+id/textView8"
android:layout_below="#+id/textView7"
android:layout_alignLeft="#+id/textView7"
android:layout_alignStart="#+id/textView7" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Alkyne"
android:id="#+id/textView9"
android:layout_below="#+id/textView8"
android:layout_alignLeft="#+id/textView8"
android:layout_alignStart="#+id/textView8" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BACK"
android:id="#+id/button2"
android:onClick="mainPage"
android:layout_below="#+id/textView9"
android:layout_alignRight="#+id/textView8"
android:layout_alignEnd="#+id/textView8" />
</RelativeLayout>
</ScrollView>
Scroll view tag can have only one child element
Put your content of scroll view in linear layout.
<ScrollView>
<LinearLayout>
.......
.......
.....
</LinearLayout>
</ScrollView>
here i have got a problem with my layout.xml.here i am trying to list full details of an event in here all the text overlaps on to each other when i am trying to edit it Through java file.As in the following pic i attached in the que.any help is thank full.
Layout.xml
<RelativeLayout 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=".Logout" >
<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="Event Name :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView2"
android:layout_alignBottom="#+id/textView2"
android:layout_alignRight="#+id/Eventname"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView1"
android:layout_alignRight="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginTop="29dp"
android:text="Location :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView2"
android:layout_marginTop="30dp"
android:text="Contact person :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView3"
android:layout_alignBottom="#+id/textView3"
android:layout_marginLeft="14dp"
android:layout_toRightOf="#+id/textView3"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView3"
android:layout_below="#+id/textView3"
android:layout_marginTop="40dp"
android:text="Start Date :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView4"
android:layout_alignBottom="#+id/textView4"
android:layout_centerHorizontal="true"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView4"
android:layout_below="#+id/textView4"
android:layout_marginTop="34dp"
android:text="End Date :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/End"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/Start"
android:layout_alignTop="#+id/textView5"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView5"
android:layout_below="#+id/textView5"
android:layout_marginTop="38dp"
android:text="Description :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/Location"
android:layout_alignTop="#+id/textView6"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
<Button
android:id="#+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textView6"
android:layout_centerHorizontal="true"
android:layout_marginTop="42dp"
android:text="CALL"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Eventname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView2"
android:layout_toRightOf="#+id/textView3"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
</RelativeLayout>
Try this..
<LinearLayout 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:orientation="vertical"
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=".Logout" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Event Name :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Eventname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Location :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Contact person :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Start Date :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="End Date :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/End"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal" >
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Description :"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:ignore="HardcodedText" />
<TextView
android:id="#+id/Desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
</LinearLayout>
<Button
android:id="#+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="CALL"
tools:ignore="HardcodedText" />
</LinearLayout>
I want a page which has a static header and footer with scrollable content inside. This is my layout:
<RelativeLayout 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"
tools:context=".MainActivity" >
<LinearLayout
android:id="#+id/headerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/sendfunds" />
</LinearLayout>
<ScrollView
android:id="#+id/scrollablContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/footerView"
android:layout_below="#+id/headerView" >
<RelativeLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="26dp"
android:text="Balance"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="8pt"
android:textStyle="bold" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView1"
android:layout_centerHorizontal="true"
android:text="TextView" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView2"
android:layout_alignBottom="#+id/textView2"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/textView2"
android:text="TextView" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:layout_marginTop="34dp"
android:text="WHO ARE YOU SENDING MONEY TO?"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="8pt" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView4"
android:layout_marginTop="35dp"
android:text="Recipient Name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText1"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView5"
android:layout_alignBottom="#+id/textView5"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText1"
android:layout_marginTop="25dp"
android:text="Recipient Email"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView6"
android:layout_alignBottom="#+id/textView6"
android:layout_alignLeft="#+id/editText1"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/editText2"
android:layout_marginTop="37dp"
android:text="HOW MUCH DO YOU WANT TO SEND?"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="8pt" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView7"
android:layout_marginTop="34dp"
android:text="Amount"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView8"
android:layout_alignBottom="#+id/textView8"
android:layout_alignLeft="#+id/editText2"
android:layout_alignParentRight="true"
android:ems="10" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText3"
android:layout_marginTop="24dp"
android:text="Wallet Cat."
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText3"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/textView9" />
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView9"
android:layout_alignBottom="#+id/textView9"
android:layout_alignLeft="#+id/spinner1"
android:layout_marginLeft="22dp"
android:text="TextView"
android:visibility="gone" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView9"
android:layout_marginTop="35dp"
android:text="Pay Ref."
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView11"
android:layout_alignLeft="#+id/spinner1"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView11"
android:layout_marginTop="27dp"
android:text="Detail Ref."
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView12"
android:layout_alignLeft="#+id/editText4"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView12"
android:layout_marginTop="39dp"
android:text="Date of Birth"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView13"
android:layout_alignLeft="#+id/editText5"
android:ems="10" />
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView13"
android:layout_marginTop="40dp"
android:text="Password"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView14"
android:layout_alignLeft="#+id/editText6"
android:layout_alignParentRight="true"
android:ems="10" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/editText7"
android:layout_marginTop="37dp"
android:layout_toLeftOf="#+id/textView3"
android:text="Submit" />
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/footerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/wallet_ic" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView1"
android:src="#drawable/send_ic_hover" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView2"
android:src="#drawable/upload_ic" />
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imageView3"
android:src="#drawable/history1" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imageView4"
android:src="#drawable/more" />
</RelativeLayout>
</RelativeLayout>
With this I have the static header and footer but some of the scrollable content is missing. I tried increasing the height of the ScrollView and layout and fillViewport=true but no luck. How should I increase the height of the middle layout?
You can solve this by using a LinearLayout container instead of RelativeLayout container.
The container should have 3 children: Header, Content, and Footer. Where the Content's height is set to fill the remaining space. You can do that by using the weight attribute:
android:layout_height="0dp"
android:layout_weight="1"
Use this code:
<LinearLayout 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:orientation="vertical"
tools:context=".MainActivity" >
<LinearLayout
android:id="#+id/headerView"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/sendfunds" />
</LinearLayout>
<ScrollView
android:id="#+id/scrollablContent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<RelativeLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- Your Content -->
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/footerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/wallet_ic" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView1"
android:src="#drawable/send_ic_hover" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView2"
android:src="#drawable/upload_ic" />
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imageView3"
android:src="#drawable/history1" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imageView4"
android:src="#drawable/more" />
</RelativeLayout>
</LinearLayout>
Notice that using
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true
is meaningless within LinearLayout. So this:
<LinearLayout
android:id="#+id/headerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/sendfunds" />
</LinearLayout>
is wrong.
try this layout with small change in your layout
<RelativeLayout 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"
tools:context=".MainActivity" >
<LinearLayout
android:id="#+id/headerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/sendfunds" />
</LinearLayout>
<RelativeLayout
android:id="#+id/footerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/wallet_ic" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView1"
android:src="#drawable/send_ic_hover" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView2"
android:src="#drawable/upload_ic" />
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imageView3"
android:src="#drawable/history1" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imageView4"
android:src="#drawable/more" />
</RelativeLayout>
<ScrollView
android:id="#+id/scrollablContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/footerView"
android:layout_below="#+id/headerView" >
<RelativeLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="26dp"
android:text="Balance"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="8pt"
android:textStyle="bold" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView1"
android:layout_centerHorizontal="true"
android:text="TextView" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView2"
android:layout_alignBottom="#+id/textView2"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/textView2"
android:text="TextView" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:layout_marginTop="34dp"
android:text="WHO ARE YOU SENDING MONEY TO?"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="8pt" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView4"
android:layout_marginTop="35dp"
android:text="Recipient Name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText1"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView5"
android:layout_alignBottom="#+id/textView5"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText1"
android:layout_marginTop="25dp"
android:text="Recipient Email"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView6"
android:layout_alignBottom="#+id/textView6"
android:layout_alignLeft="#+id/editText1"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/editText2"
android:layout_marginTop="37dp"
android:text="HOW MUCH DO YOU WANT TO SEND?"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="8pt" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView7"
android:layout_marginTop="34dp"
android:text="Amount"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView8"
android:layout_alignBottom="#+id/textView8"
android:layout_alignLeft="#+id/editText2"
android:layout_alignParentRight="true"
android:ems="10" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText3"
android:layout_marginTop="24dp"
android:text="Wallet Cat."
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText3"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/textView9" />
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView9"
android:layout_alignBottom="#+id/textView9"
android:layout_alignLeft="#+id/spinner1"
android:layout_marginLeft="22dp"
android:text="TextView"
android:visibility="gone" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView9"
android:layout_marginTop="35dp"
android:text="Pay Ref."
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView11"
android:layout_alignLeft="#+id/spinner1"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView11"
android:layout_marginTop="27dp"
android:text="Detail Ref."
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView12"
android:layout_alignLeft="#+id/editText4"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView12"
android:layout_marginTop="39dp"
android:text="Date of Birth"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView13"
android:layout_alignLeft="#+id/editText5"
android:ems="10" />
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView13"
android:layout_marginTop="40dp"
android:text="Password"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView14"
android:layout_alignLeft="#+id/editText6"
android:layout_alignParentRight="true"
android:ems="10" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/editText7"
android:layout_marginTop="37dp"
android:layout_toLeftOf="#+id/textView3"
android:text="Submit" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
try this
<LinearLayout 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"
tools:context=".MainActivity"
android:orientation=”vertical” >
<LinearLayout
android:id="#+id/headerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/sendfunds" />
</LinearLayout>
<ScrollView
android:id="#+id/scrollablContent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=1
>
<RelativeLayout
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="30dp"
android:layout_marginTop="26dp"
android:text="Balance"
android:textStyle="bold"
android:textSize="8pt"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView1"
android:layout_centerHorizontal="true"
android:text="TextView" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView2"
android:layout_alignBottom="#+id/textView2"
android:layout_marginLeft="16dp"
android:layout_toRightOf="#+id/textView2"
android:text="TextView" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView1"
android:layout_marginTop="34dp"
android:text="WHO ARE YOU SENDING MONEY TO?"
android:textSize="8pt"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView4"
android:layout_marginTop="35dp"
android:text="Recipient Name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText1"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView5"
android:layout_alignBottom="#+id/textView5"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText1"
android:layout_marginTop="25dp"
android:text="Recipient Email"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView6"
android:layout_alignBottom="#+id/textView6"
android:layout_alignLeft="#+id/editText1"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/editText2"
android:layout_marginTop="37dp"
android:text="HOW MUCH DO YOU WANT TO SEND?"
android:textSize="8pt"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView7"
android:layout_marginTop="34dp"
android:text="Amount"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView8"
android:layout_alignBottom="#+id/textView8"
android:layout_alignLeft="#+id/editText2"
android:layout_alignParentRight="true"
android:ems="10" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editText3"
android:layout_marginTop="24dp"
android:text="Wallet Cat."
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText3"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/textView9" />
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView9"
android:layout_alignBottom="#+id/textView9"
android:layout_alignLeft="#+id/spinner1"
android:layout_marginLeft="22dp"
android:text="TextView"
android:visibility="gone" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView9"
android:layout_marginTop="35dp"
android:text="Pay Ref."
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView11"
android:layout_alignLeft="#+id/spinner1"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView11"
android:layout_marginTop="27dp"
android:text="Detail Ref."
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView12"
android:layout_alignLeft="#+id/editText4"
android:layout_alignParentRight="true"
android:ems="10" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView12"
android:layout_marginTop="39dp"
android:text="Date of Birth"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView13"
android:layout_alignLeft="#+id/editText5"
android:ems="10" />
<TextView
android:id="#+id/textView14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView13"
android:layout_marginTop="40dp"
android:text="Password"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="#+id/editText7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/textView14"
android:layout_alignLeft="#+id/editText6"
android:layout_alignParentRight="true"
android:ems="10" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/editText7"
android:layout_marginTop="37dp"
android:layout_toLeftOf="#+id/textView3"
android:text="Submit" />
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/footerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="#drawable/wallet_ic" />
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView1"
android:src="#drawable/send_ic_hover" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/imageView2"
android:src="#drawable/upload_ic" />
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imageView3"
android:src="#drawable/history1" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/imageView4"
android:src="#drawable/more" />
</RelativeLayout>
</LinearLayout >