首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在2列的自定义网格视图中设置滚动视图

如何在2列的自定义网格视图中设置滚动视图
EN

Stack Overflow用户
提问于 2013-09-12 08:03:18
回答 3查看 735关注 0票数 0
代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <GridView
        android:id="@+id/gridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:horizontalSpacing="0dp"
        android:numColumns="2"
        android:stretchMode="columnWidth"
        android:verticalSpacing="0dp" />

</FrameLayout>

如何在这个布局中添加滚动视图我必须在这个布局中添加更多的图片,但它不会显示超过6个图像。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-09-12 08:43:04

您可以降低gridView高度和gridView将滚动。

票数 1
EN

Stack Overflow用户

发布于 2013-09-12 08:41:17

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >

    <GridView
        android:id="@+id/gridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:horizontalSpacing="0dp"
        android:numColumns="2"
        android:stretchMode="columnWidth"
        android:verticalSpacing="0dp" />
</ScrollView>
</FrameLayout>

尝尝这个。

票数 1
EN

Stack Overflow用户

发布于 2013-09-12 08:39:04

有点不清楚的问题,但我想你想要这个?

代码语言:javascript
复制
<FrameLayout>
<ScrollView>
<GridView> 
</GridView>
</ScrollView>
</FrameLayout>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18758733

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档