唯一的方法是使用双向网格视图库使用以下库链接
https://github.com/jess-anders/two-way-gridview
1) 将该库添加到项目中
2) 在将插入水平滚动视图的xml布局中相应地更改包名称
片段:
<com.future.android.app.library.slidinggridview.TwoWayGridView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@id/fragment_product_twgv_grid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:visibility="gone"
app:cacheColorHint="#ffe8e8e8"
app:columnWidth="300dp"
app:horizontalSpacing="10.0dip"
app:numColumns="auto_fit"
app:numRows="2"
app:rowHeight="290dp"
android:fastScrollEnabled="true"
app:scrollDirectionLandscape="horizontal"
app:scrollDirectionPortrait="vertical"
app:stretchMode="spacingWidthUniform"
app:verticalSpacing="10.0dip" />
您可以相应地设置列数以及宽度和高度。