Android 为什么Gridview的水平滚动条不工作?
布局: 我已经通过Android 为什么Gridview的水平滚动条不工作?,android,Android,布局: 我已经通过listImage myGV= (GridView) findViewById(R.id.galleryImage); listImage = new profileAdapter(this, R.layout.layoutimage); myGV.setAdapter(listImage); 为什么Gridview的水平滚动条不工作?您好,请使用下面的xml代码,我添加了水平滚动视图 myGV.setNumColumns(listImage.getCount()); 您
listImage
myGV= (GridView) findViewById(R.id.galleryImage);
listImage = new profileAdapter(this, R.layout.layoutimage);
myGV.setAdapter(listImage);
为什么Gridview的水平滚动条不工作?您好,请使用下面的xml代码,我添加了水平滚动视图
myGV.setNumColumns(listImage.getCount());
您没有向适配器传递任何数据,是否有足够的项目可滚动?如果我向listImage添加更多项目,则项目将缩小,它不显示滚动。您正在尝试实现全屏图像的滑动类型功能吗?而不是父级LinearLayout
tryHorizontal Scrollview
我正在尝试实现Gridview显示图像相同的Gallery请在Gridview中添加android:layout\u width=“fill\u parent”
myGV.setNumColumns(listImage.getCount());
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tool"
android:id="@+id/horizontalScrollView1"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:fillViewport="true" >
<GridView
android:id="@+id/galleryImage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:numColumns="6">
</GridView>
</HorizontalScrollView>