I am trying to make the contents of Relative Layout as Scrollview as its not fitting in the screen. My XML file that consists of both, Linear and Relative Layout where Linear is acting as Parent and Relative as child layout.
Although I have browsed, most of the questions regarding this topic, but all i could find is how to insert Scrollview in Linear or Relative Layout respectively but not when both layouts are in one file.
my XML file
<?xml version="1.0" encoding="UTF-8"?>
<!--
Being of Linear Layout
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/week1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/week1"
android:textColor="#FFFFFF"
android:textSize="25sp"
android:paddingTop="50dp"
android:background="#00141c" />
<!--
Begin Relative Layout
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollHorizontally="true">
<ImageView
android:id="@+id/treadmillimage"
android:layout_width="115dp"
android:layout_height="93dp"
android:paddingTop="10dp"
android:src="@drawable/treadmill" />
<EditText
android:id="@+id/durOnTreadmill"
android:layout_width="129dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:layout_marginLeft="180dp"
android:layout_centerVertical="true"/>
<!--
End Relative Layout
-->
</RelativeLayout>
<TextView
android:id="@+id/treadmilltext"
android:layout_width="91dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="@string/treadmill"
android:textColor="#FFFFFF"
android:textSize="20sp" />
<!--
Begin Relative Layout
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollHorizontally="true">
<ImageView
android:id="@+id/stepperimage"
android:layout_width="115dp"
android:layout_height="93dp"
android:paddingTop="10dp"
android:src="@drawable/stepper" />
<EditText
android:id="@+id/durOnStepper"
android:layout_width="129dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:layout_marginLeft="180dp"
android:layout_centerVertical="true"/>
<!--
End Relative Layout
-->
</RelativeLayout>
<TextView
android:id="@+id/steppertext"
android:layout_width="91dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="@string/stepper"
android:textColor="#FFFFFF"
android:textSize="20sp" />
<!--
Begin Relative Layout
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollHorizontally="true">
<ImageView
android:id="@+id/stationaryrowing"
android:layout_width="115dp"
android:layout_height="93dp"
android:paddingTop="10dp"
android:src="@drawable/stationaryrowing" />
<EditText
android:id="@+id/durOnStationaryRowing"
android:layout_width="129dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:layout_marginLeft="180dp"
android:layout_centerVertical="true"/>
<!--
End Relative Layout
-->
</RelativeLayout>
<TextView
android:id="@+id/stationaryrowingtext"
android:layout_width="91dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="@string/stationaryrowing"
android:textColor="#FFFFFF"
android:textSize="20sp" />
<!--
Begin Relative Layout
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollHorizontally="true">
<ImageView
android:id="@+id/exercisebikeimage"
android:layout_width="115dp"
android:layout_height="93dp"
android:paddingTop="10dp"
android:src="@drawable/excerisebike" />
<EditText
android:id="@+id/durOnexcerisebike"
android:layout_width="129dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:layout_marginLeft="180dp"
android:layout_centerVertical="true"/>
<!--
End Relative Layout
-->
</RelativeLayout>
<TextView
android:id="@+id/excerisebiketext"
android:layout_width="91dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="@string/exercisebike"
android:textColor="#FFFFFF"
android:textSize="20sp" />
<!--
Begin Relative Layout
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollHorizontally="true">
<ImageView
android:id="@+id/ellipticaltrainerimage"
android:layout_width="115dp"
android:layout_height="93dp"
android:paddingTop="10dp"
android:src="@drawable/ellipticaltrainer" />
<EditText
android:id="@+id/durOnellipticaltrainer"
android:layout_width="129dp"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:layout_marginLeft="180dp"
android:layout_centerVertical="true"/>
<!--
End Relative Layout
-->
</RelativeLayout>
<TextView
android:id="@+id/ellipticaltrainertext"
android:layout_width="91dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="@string/ellipticaltrainer"
android:textColor="#FFFFFF"
android:textSize="20sp" />
<!--
End Linear Layout
-->
</LinearLayout>
All the contents below TextView of Week 1 are required to be in Scrollview
Thanks in advance, will really appreciate all the answers :)