在Android中滚动查看

斯瓦米·维拉(Swamy Veera)

首先,对于我的英语不好,对于如何显示我的“可扩展列表视图”和“网格视图”,我感到很抱歉,在尝试这样做时,我遇到了错误
:渲染期间引发异常:

Scroll View can host only one direct child
Exception details are logged in Window > Show View > Error Log

代码 :

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.samp.sampleproh.MainActivity"
android:orientation="vertical" >



 <ExpandableListView
    android:id="@+id/lvExp"
    android:layout_width="match_parent"
    android:layout_height="205dp"
    android:layout_weight="0.41"
    android:cacheColorHint="#00000000" >
</ExpandableListView>


    <GridView
   android:id="@+id/gridview"
   android:layout_width="fill_parent" 
   android:layout_height="fill_parent"
   android:columnWidth="90dp"
   android:numColumns="auto_fit"
   android:verticalSpacing="10dp"
   android:horizontalSpacing="10dp"
   android:stretchMode="columnWidth"
   android:gravity="center"/>
</ScrollView>
帕蒂·巴亚尼

您需要将可扩展的listview和gridview添加到一种常见的相对布局中,这将解决您的问题。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <ExpandableListView
                android:id="@+id/lvExp"
                android:layout_width="match_parent"
                android:layout_height="205dp"
                android:layout_weight="0.41"
                android:cacheColorHint="#00000000"></ExpandableListView>

            <GridView
                android:id="@+id/gridview"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_below="@+id/lvExp"
                android:columnWidth="90dp"
                android:gravity="center"
                android:horizontalSpacing="10dp"
                android:numColumns="auto_fit"
                android:stretchMode="columnWidth"
                android:verticalSpacing="10dp" />
        </RelativeLayout>
    </ScrollView>
</RelativeLayout>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

查看用于在android中滚动活动的寻呼机

来自分类Dev

查看用于在android中滚动活动的寻呼机

来自分类Dev

Android RecyclerView平滑滚动以查看动画高度

来自分类Dev

Android禁用滚动并单击以查看列表视图

来自分类Dev

如何在Android中通过意图查看的图像之间滚动

来自分类Dev

无法查看或滚动到ScrollViewer中的项目

来自分类Dev

在Android中滚动图像

来自分类Dev

在Android中滚动div

来自分类Dev

Android-Espresso-滚动到非列表查看项目

来自分类Dev

在Android中查看最终查询

来自分类Dev

在 Android 中查看 AGPS 设置

来自分类Dev

在滚动查看器中居中显示所选项目

来自分类Dev

Bash:您如何查看终端中“滚动过度”的文本?

来自分类Dev

是否可以在Excel中滚动查看图表?

来自分类Dev

如何向上滚动并查看GNU屏幕中的数据

来自分类Dev

在可滚动的寻呼机中查看命令输出

来自分类Dev

滚动查看特定的孩子

来自分类Dev

Robotium滚动查看

来自分类Dev

即使将滚动条放入滚动查看器中,滚动条也不显示在堆栈面板中

来自分类Dev

Android中的ListView可滚动

来自分类Dev

android webview中的无限滚动

来自分类Dev

在HorizontalListView中滚动的问题(android)

来自分类Dev

在Android中滚动旋转视图

来自分类Dev

Android中的无限ListView滚动

来自分类Dev

滚动滚动手动查看带有手势的程序中的ViewDetector?

来自分类Dev

在delphi的滚动框中滚动时,如何查看组件是否不可见?

来自分类Dev

如何使 XAML 中滚动查看器的滚动条成为非交互式

来自分类Dev

在 Firefox 中的伪造查看器内禁用触摸板滚动页面滚动

来自分类Dev

前端在Ubuntu中查看Android的视频

Related 相关文章

热门标签

归档