I've got some linearlayouts and some views in my scrollview which covers the whole screen. The problem is that I can see that one of my widgets is under the screen and it won't scroll down. This is my xml file
<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="${relativePackage}.${activityClass}" >
<ScrollView
android:id="@+id/mainScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:scrollbars="vertical" >
<LinearLayout
android:id="@+id/mainLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textDateTime"
android:layout_width="wrap_content"
android:text="@string/nullString"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FFCCFF99"
android:textSize="25sp" />
<LinearLayout
android:id="@+id/buttonsLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_margin="5dp"
android:orientation="horizontal" >
<Button
android:id="@+id/buttonReset"
style="?android:attr/buttonStyleSmall"
android:layout_width="130sp"
android:layout_height="40dp"
android:background="@drawable/button"
android:text="@string/buttonResetText"
android:textColor="#000000"
android:textSize="20sp" />
<Button
android:id="@+id/buttonFreeze"
style="?android:attr/buttonStyleSmall"
android:layout_width="130sp"
android:layout_height="40sp"
android:layout_marginLeft="5dp"
android:background="@drawable/button"
android:text="@string/buttonFreezeText"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
</RelativeLayout>
<ProgressBar
android:id="@+id/loadBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="118dp"
android:layout_height="118dp"
android:layout_gravity="center" />
<GridView
android:id="@+id/sensorsGrid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#FFCCFF99"
android:gravity="center"
android:numColumns="6"
android:stretchMode="none" >
</GridView>
</LinearLayout>
</ScrollView>
</RelativeLayout>
I also add a GraphView to mainLayout in code like this
graph = new LineGraphView(this, "GraphViewDemo");
graph.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 300));
LinearLayout mainLayout = (LinearLayout) findViewById(R.id.mainLayout);
mainLayout.addView(graph);
Another problem is that if the GridView doesn't fit vertically to the mainlayout (cause it is larger) than the gridView becomes scrollable (which I don't want) and the GraphView which is below cannot be seen and I cant scroll down to it
UPDATE: current xml
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="${relativePackage}.${activityClass}"
android:id="@+id/mainScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:scrollbars="vertical" >
<LinearLayout
android:id="@+id/mainLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF023458"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textDateTime"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_margin="5dp"
android:text="@string/nullString"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FFCCFF99"
android:textSize="25sp" />
<LinearLayout
android:id="@+id/buttonsLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_margin="5dp"
android:orientation="horizontal" >
<Button
android:id="@+id/buttonReset"
style="?android:attr/buttonStyleSmall"
android:layout_width="130sp"
android:layout_height="40dp"
android:background="@drawable/button"
android:text="@string/buttonResetText"
android:textColor="#000000"
android:textSize="20sp" />
<Button
android:id="@+id/buttonFreeze"
style="?android:attr/buttonStyleSmall"
android:layout_width="130sp"
android:layout_height="40sp"
android:layout_marginLeft="5dp"
android:background="@drawable/button"
android:text="@string/buttonFreezeText"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
</RelativeLayout>
<ProgressBar
android:id="@+id/loadBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="118dp"
android:layout_height="118dp"
android:layout_gravity="center" />
<GridView
android:id="@+id/sensorsGrid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#FFCCFF99"
android:gravity="center"
android:numColumns="6"
android:stretchMode="none" >
</GridView>
</LinearLayout>
</ScrollView>