Horizontal and vertical scrollbar in Android with tablets?

Please help me if you know how to add both scrollbars.
First of all, I understood everything.
I added both scrollbars to tablelayout, but the main problem is that I use dynamic data to populate tablerow. Thus, if there is only one record, therefore, horizontal scroll up from the top after the data. but I want to show horizontal from below, and also show vertical.


Thanks
Prashant

+5
source share
3 answers

Use this code.

<ScrollView
android:id="@+id/scrllvwNo1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
//TextView
//Button
</ScrollView>
</LinearLayout> 
+2
source

, .

<ScrollView android:id="@+id/layout" android:layout_height="fill_parent"
    android:layout_alignParentBottom="true"
    android:scrollbars="horizontal|vertical" android:layout_width="fill_parent"
    android:layout_marginTop="50dip"
    android:scrollbarStyle="outsideInset">
<HorizontalScrollView android:id="@+id/horizontalView" android:layout_height="fill_parent"
    android:scrollbars="horizontal|vertical" android:layout_width="wrap_content"
    android:layout_marginTop="50dip">
    <RelativeLayout android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:id="@+id/RelativeLayout">

    <ImageView android:id="@+id/imgView" android:maxHeight="280dip"
            android:layout_marginLeft="20dip"   
            android:layout_marginTop="10dip"
            android:src="@drawable/ic_facebook" android:maxWidth="280dip"
            android:scaleType="centerInside"
            android:layout_height="280dip" 
            android:layout_width="280dip"></ImageView>
    </RelativeLayout>
</HorizontalScrollView>

+1

All Articles