0
我有我的佈局滾動問題。下面的佈局工作正常。我有一個水平滾動和下方的畫廊視圖,有一個列表視圖滾動垂直滾動。現在,當我向下滾動列表視圖的底部時,圖庫視圖應該向上滾動,以便列表視圖將單獨佔用整個屏幕和列表視圖。同樣,當我向上滾動時,圖庫視圖應該回到頂部。是否有辦法通過隱藏/顯示圖庫視圖來處理這個問題?Android中的佈局滾動問題
XML佈局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#c6c6c6"
android:padding="10dp" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout_alignParentLeft="true"
android:text="Stores"
android:textSize="20dp" />
</RelativeLayout>
<Gallery
android:id="@+id/gallery1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:gravity="left"
android:listSelector="@color/gridviewlistselector"
android:paddingLeft="10dp"
android:paddingRight="20dp"
android:paddingTop="10dp"
android:spacing="10dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#c6c6c6"
android:padding="10dp" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout_alignParentLeft="true"
android:text="Products"
android:textSize="20dp" />
</RelativeLayout>
<GridView
android:id="@+id/product_grid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/texture"
android:drawSelectorOnTop="true"
android:horizontalSpacing="5dp"
android:listSelector="@color/gridviewlistselector"
android:numColumns="2"
android:stretchMode="columnWidth"
android:verticalSpacing="5dp" />
</LinearLayout>
</LinearLayout>