Android Layout alignment messed up in Landscape - android

This is my first coding in Android. I have a device with 5" screen and 854*480 resolution . The following code looks perfect on portrait but everything moved left on landscape mode(it looks really bad). I have used dp units as it is recommended but still it is not aligning correctly. What am I doing wrong?
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/ScrollView01"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="#+id/RelativeLayout01"
android:layout_width="match_parent"
android:layout_height="753dp"
android:background="#color/orange" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="90dp"
android:layout_marginTop="120dp"
android:text="HS6151"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="90dp"
android:layout_marginTop="165dp"
android:text="PH6151"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="90dp"
android:layout_marginTop="210dp"
android:text="CY6151"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="90dp"
android:layout_marginTop="255dp"
android:text="GE6151"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="90dp"
android:layout_marginTop="300dp"
android:text="GE6152"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="90dp"
android:layout_marginTop="345dp"
android:text="GE6161"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="90dp"
android:layout_marginTop="390dp"
android:text="GE6162"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="90dp"
android:layout_marginTop="435dp"
android:text="GE6163"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="65dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="110dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="155dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="200dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="245dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="290dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="335dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="380dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<spinner
android:id="#+id/spinner9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="425dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/spinner9"
android:layout_centerHorizontal="true"
android:layout_marginTop="19dp"
android:text="calculate" />
<space
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="55dp" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="SEMESTER I - GPA CALCULATOR"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20dp" />
<TextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/button1"
android:layout_centerHorizontal="true"
android:layout_marginTop="1dp"
android:editable="false"
android:ems="10"
android:gravity="center"
android:inputType="number"
android:textSize="20dp" />
<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="90dp"
android:layout_marginTop="75dp"
android:text="MA6151"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</ScrollView>

1. Using a fixed height for your container isn't a good idea: android:layout_height="753dp" because in landscape, your height won't be 854, but 480.
As an alternative, you can use two same-named xml layouts in res/layout-port and res/layout-land, with specific designs.
2. Most of your controls are aligned to the left by design, in portrait mode.
So, they will be left aligned also in landscape, if you don't provide an alternative layout file as described above.

Related

Exception raised during rendering: Circular dependencies cannot exist in RelativeLayout

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.

android activity does not scroll down

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>

AdView Force closes

I added a admob AdView to my layout but after adding my app force closes what might be the reason.
Have I done something wrong plz correct me. Without that adView my app works perfectly.
or do I have to add anything in the main_activity file?
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="#+id/ScrollView01"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cyan" >
<RelativeLayout
android:id="#+id/RelativeLayout01"
android:layout_width="match_parent"
android:layout_height="914dp" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="120dp"
android:text="TECHNICAL\nENGLISH -I"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="185dp"
android:text="ENGINEERING\nPHYSICS I"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="250dp"
android:text="ENGINEERING\nCHEMISTRY I"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="315dp"
android:text="COMPUTER\nPROGRAMMING"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="380dp"
android:text="ENGINEERING\nGRAPHICS"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="445dp"
android:text="COMPUTER\nPRGRAMMING LAB"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="510dp"
android:text="ENGINEERING\nPRACTICES LAB"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="575dp"
android:text="PHYSICS\nCHEMISTRY LAB"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="65dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="110dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="175dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="240dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="305dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="370dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="435dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="500dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="565dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="SEMESTER I - GPA CALCULATOR"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp" />
<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="15dp"
android:layout_marginTop="75dp"
android:text="MATHEMATICS - I"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView9"
android:layout_centerHorizontal="true"
android:layout_marginTop="37dp"
android:text="CALCULATE" />
<TextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/button1"
android:layout_centerHorizontal="true"
android:layout_marginTop="13dp"
android:ems="10"
android:gravity="center"
android:textSize="20sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/editText1"
android:layout_marginTop="58dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="#+id/textView8" >
<com.google.ads.AdView
android:id="#+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="a15325d1ef2568c"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_DEVICE_ID" >
</com.google.ads.AdView>
</LinearLayout>
</RelativeLayout>
</ScrollView>

Color is not changing

How do I change the orange color in this picture. I have removed all reference of orange color in my code but it still appears. How do I remove them?
I previously used orange but now I changed it to cyan but when app is lauched it appears for a second before changing to cyan.
My layout file
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/ScrollView01"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cyan" >
<RelativeLayout
android:id="#+id/RelativeLayout01"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="120dp"
android:text="TECHNICAL\nENGLISH -I"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="185dp"
android:text="ENGINEERING\nPHYSICS I"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="250dp"
android:text="ENGINEERING\nCHEMISTRY I"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="315dp"
android:text="COMPUTER\nPROGRAMMING"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="380dp"
android:text="ENGINEERING\nGRAPHICS"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="445dp"
android:text="COMPUTER\nPRGRAMMING LAB"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="510dp"
android:text="ENGINEERING\nPRACTICES LAB"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="575dp"
android:text="PHYSICS\nCHEMISTRY LAB"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="65dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="110dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="175dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="240dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="305dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="370dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="435dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="500dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:id="#+id/spinner9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="200dp"
android:layout_marginTop="565dp"
android:entries="#array/Grade"
android:prompt="#string/hello_world"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/textView11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="SEMESTER I - GPA CALCULATOR"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp" />
<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="15dp"
android:layout_marginTop="75dp"
android:text="MATHEMATICS - I"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="18sp" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView9"
android:layout_centerHorizontal="true"
android:layout_marginTop="37dp"
android:text="calculate"
android:background="#color/cyand" />
<TextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/button1"
android:layout_centerHorizontal="true"
android:layout_marginTop="13dp"
android:ems="10"
android:gravity="center"
android:textSize="20sp" />
</RelativeLayout>
</ScrollView>
My color.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="cyand">#00FFFF</color>
<color name="cyan">#CCFFFF</color>
</resources>

Please help my ListView stop vertical scrolling

I've created a ListView in a nested LinearLayouts with Horizontal scrolling in an attempt to display long records with the capability for Horizontal scrolling, but now I'm unable to scroll the ListView vertically.
Here is my XML setup. Can you help me figure out why the ListView stop scrolling. I've found several article tried difference Width, Height and Weight layout, but nothing seems to work.
Thank you in advance for your help.
<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=".ProductReview" >
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="40sp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:contentDescription="#string/lyellow_strip"
android:scaleType="centerCrop"
android:src="#drawable/shell_strip" />
<ImageView
android:id="#+id/imgVCancel"
android:layout_width="27sp"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/imageView2"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginRight="224dp"
android:clickable="true"
android:contentDescription="#string/btnCancel"
android:onClick="Cancel"
android:src="#drawable/cancel32" />
<HorizontalScrollView
android:id="#+id/horizontalScrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/imageView2" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="527dp"
android:orientation="horizontal" >
<LinearLayout
android:layout_width = "match_parent"
android:layout_height = "wrap_content"
android:layout_marginLeft="40dp"
android:orientation = "horizontal">
<TextView
android:id="#+id/code"
android:layout_width="110sp"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="Type"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/manufacturer"
android:layout_width="70sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/code"
android:maxLines="1"
android:text="Manu"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/name"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/manufacturer"
android:maxLines="1"
android:text="Product Name"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/visc40"
android:layout_width="80sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/name"
android:maxLines="1"
android:text="Visc 40"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/visc100"
android:layout_width="80sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/visc40"
android:maxLines="1"
android:text="Visc 100"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/viscindex"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/visc100"
android:maxLines="1"
android:text="Visc Index"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/den15c"
android:layout_width="80sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/viscindex"
android:maxLines="1"
android:text="Den#15c"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/name1"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/den15c"
android:maxLines="1"
android:text="Product Name"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/visctext"
android:layout_width="150sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/name1"
android:maxLines="1"
android:text="Visc Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/baseoiltype"
android:layout_width="150sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/visctext"
android:maxLines="1"
android:text="Base Oil Type"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/name2"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/baseoiltype"
android:maxLines="1"
android:text="Product Name"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/baseoil"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/name2"
android:maxLines="1"
android:text="Base Oil"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/additives"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/baseoil"
android:maxLines="1"
android:text="Additives"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/name3"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/additives"
android:maxLines="1"
android:text="Product Name"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/otheradditives"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/name3"
android:maxLines="1"
android:text="Other Properties"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/thickener"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/otheradditives"
android:maxLines="1"
android:text="Thickener"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/nlgi"
android:layout_width="70sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/thickener"
android:maxLines="1"
android:text="NLGI"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/name4"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/nlgi"
android:maxLines="1"
android:text="Product Name"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="#+id/comments"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/name4"
android:maxLines="1"
android:text="Comments"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/packages"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/comments"
android:maxLines="1"
android:text="Packages"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/area"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/packages"
android:maxLines="1"
android:text="Areas"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
<TextView
android:id="#+id/usage"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="11dp"
android:layout_toRightOf="#+id/area"
android:maxLines="1"
android:text="Usage"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="17sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width = "match_parent"
android:layout_height = "wrap_content"
android:layout_marginLeft="-4060dp"
android:layout_marginTop="30dp"
android:orientation = "horizontal">
<ListView
android:id="#+id/listView1"
android:layout_width="0dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:clickable="true"
android:fastScrollEnabled="true"
android:headerDividersEnabled="true"
android:smoothScrollbar="true" >
</ListView>
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>
I've figured out what to do. This is probably not the best way, but it work for us. I put the column headers one linear layout and the ListView in another. Thanks.

Categories

Resources