布局文件:
<ScrollView
android:id="@+id/ptrsl"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:src="@drawable/mz8"/>
<com.jd.jdvip.widget.GridViewForScrollView
android:id="@+id/benefit_gv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:horizontalSpacing="5dp"
android:numColumns="2"
android:overScrollMode="never"
android:verticalSpacing="5dp">
</com.jd.jdvip.widget.GridViewForScrollView>
</LinearLayout>
</ScrollView>
解决办法:在ScrollView的子布局LinearLayout加上属性
android:focusable="true"
android:focusableInTouchMode="true"