Wednesday, September 28, 2011

Vertical and Horizontal Scroll on a Layout in Android

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/cybersportsbg">

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scrollbars="vertical">

        <HorizontalScrollView
            android:id="@+id/horizontalScrollView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <LinearLayout
                android:id="@+id/linearLayout1"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal">
.....
  ----Your Layout------
........


            </LinearLayout>
            </HorizontalScrollView>
            </ScrollView>


</LinearLayout>

No comments:

Post a Comment