0

我看到了滚动线,但它不起作用。这是代码:

可能是什么原因?

布局:

<ScrollView xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

     <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            android:gravity="center_horizontal"
            android:orientation="vertical" >



            <TextView
                android:id="@+id/titleshopandsell"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_gravity="center_horizontal"
                android:text="פריטים שתוכל למכור"
                android:textColor="#880000"
                android:textSize="12sp" />



           <GridView 
               android:id="@+id/gridView1"
               android:numColumns="auto_fit"
               android:gravity="center"
               android:verticalSpacing="3dp"
               android:horizontalSpacing="2dp"
               android:columnWidth="130dp"
               android:stretchMode="columnWidth"
               android:layout_width="fill_parent"
              android:layout_height="fill_parent" >

      </GridView>
 </LinearLayout>
</ScrollView>

我的代码有什么问题?

4

1 回答 1

4

GridView也是一种特殊类型的ScrollView..您应该将父scrollView更改为Relative/Linear Layout。

目前 scrollView 和 GridView 都阻碍了正确的滚动。

于 2013-10-18T10:56:17.460 回答