Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Horizontal and vertical scrollbar in Android with tablelayout?

Please help me if you know how to add both scrollbar.
First of all i clear to all.
I added both scroll bar in tablelayout but main problem is i m using dynamic data for filling tablerow. So, if there is only one record so horizontal scroll view top after the data. but i want to show horizontal in bottom and also show vertical.


Thanks
Prashant

like image 635
PrashantAdesara Avatar asked Nov 05 '22 06:11

PrashantAdesara


2 Answers

Use this code..

<ScrollView
android:id="@+id/scrllvwNo1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
//TextView
//Button
</ScrollView>
</LinearLayout> 
like image 63
sanjay Avatar answered Nov 11 '22 03:11

sanjay


I tried this way and its run perfectly for me.

<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>

like image 36
PrashantAdesara Avatar answered Nov 11 '22 04:11

PrashantAdesara