android - how to scroll two gridview and an imagview inside scrollview together -
i having 2 gridview , imageview inside scrollview, want scroll these views together.
the first gridview have 4 items , second gridview having more 4 items.
so possible scroll together.
my layout is,
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="170dp" android:layout_alignparentleft="true" android:layout_alignparenttop="true" > </android.support.v4.view.viewpager> <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginleft="14dp" android:layout_margintop="14dp" android:src="@drawable/logo_small" android:contentdescription="@string/app_name" /> <imageview android:id="@+id/imageview3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_aligntop="@+id/imageview2" android:layout_marginright="14dp" android:src="@drawable/next" android:contentdescription="@string/app_name" /> <imageview android:id="@+id/imageview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/imageview1" android:layout_below="@+id/imageview1" android:layout_margintop="32dp" android:contentdescription="@string/app_name" android:src="@drawable/prev" /> <scrollview android:id="@+id/scrollview1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/viewpager" android:layout_centerhorizontal="true" android:isscrollcontainer="true" > <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <gridview android:id="@+id/gridview1" android:layout_width="match_parent" android:layout_height="wrap_content" android:numcolumns="2" > </gridview> <imageview android:id="@+id/iv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/gridview1" android:src="@drawable/ads" > </imageview> <gridview android:id="@+id/gridview2" android:layout_width="match_parent" android:layout_height="wrap_content" android:numcolumns="2" android:layout_below="@+id/iv" > </gridview> </relativelayout> </scrollview> </relativelayout>
it not practise put 1 scrollable view another. gridview
scrollable.
if want can refer below links
Comments
Post a Comment