Im trying to make my screen scrollable, i looked around this site for quite a while without any success. I just need to know where im going wrong. Ive tried without scrollview and with, different sites tell me to do different things. Essentially i want the screen scrollable for smaller devices to fit all the content.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/SonucScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="true"
android:scrollbars="vertical"
android:layout_gravity="center"
android:orientation="vertical"
android:background="@color/white"
>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="@color/white"
android:orientation="horizontal"
android:weightSum="1.75"
android:baselineAligned="false"
tools:context=".TourismActivity"
>
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".15"
android:orientation="horizontal" >
<TextView
android:id="@+id/button6"
android:textIsSelectable="true"
android:layout_width="0dp"
android:layout_weight=".15"
android:layout_height="fill_parent"
android:background="@color/grey"/>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout10"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".6"
android:orientation="vertical"
android:weightSum="1.2" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".3"
android:src="@drawable/abbeyleix" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".3"
android:src="@drawable/longford" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight=".3"
android:src="@drawable/tullamore" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="left"
android:layout_weight=".3"
android:src="@drawable/athlone" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout11"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".9"
android:orientation="vertical"
android:weightSum="3.7" >
<Button
android:id="@+id/buttonTourism"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".5"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:text="@string/laois"
android:textColor="@color/blue" />
<TextView
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".5"
android:background="@color/white"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:text="Located in the heart of Ireland, Laois showcases the raw beauty of nature long forgotten."
android:textColor="@color/black"
android:textSize="12sp" >
</TextView>
<Button
android:id="@+id/buttonTourism1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:textSize="13sp"
android:layout_marginLeft = "10dp"
android:layout_weight=".5"
android:textColor="@color/blue"
android:text="@string/longford" />
<TextView
android:id="@+id/editText2"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".5"
android:background="@color/white"
android:gravity="fill_vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:text="Located in the heart of the lakelands, the endless beauty and rural charm of Longford makes for a great desination"
android:textColor="@color/black"
android:textSize="12sp" >
</TextView>
<Button
android:id="@+id/buttonTourism2"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".5"
android:textSize="13sp"
android:textColor="@color/blue"
android:layout_marginLeft = "10dp"
android:text="@string/offaly" />
<TextView
android:id="@+id/editText3"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".5"
android:background="@color/white"
android:gravity="fill_vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:text="Nestled in the bosom of Slieve Bloom Mountains and the Shannon River, Offaly offers a vast plethora of beauty."
android:textColor="@color/black"
android:textColorHint="@color/red"
android:textColorLink="@color/red"
android:textSize="12sp" >
</TextView>
<Button
android:id="@+id/buttonTourism3"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:textSize="13sp"
android:layout_marginLeft = "10dp"
android:layout_weight=".5"
android:textColor="@color/blue"
android:text="@string/westmeath" />
<TextView
android:id="@+id/editText4"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight=".5"
android:background="@color/white"
android:gravity="fill_vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:text="Follow the tranquil Royal Canal as it meanders through Westmeath where the vast majesty of beauty knows no bounds."
android:textColor="@color/black"
android:textColorHint="@color/red"
android:textColorLink="@color/red"
android:textSize="12sp" >
</TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="1" >
<TextView
android:id="@+id/button7"
android:layout_width="0dp"
android:textIsSelectable="true"
android:layout_height="match_parent"
android:layout_weight="0.15"
android:background="@color/grey" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Remove the layout_weight
and weightSum
from your "vertical" LinearLayout
elements. It is causing the layout to scale to the height of the screen, so that there is nothing to scroll.
Ah, and @Selvin's comment may be required too, to make linearLayout1
height "wrap_content".