Android的,如何添加滚动型为屏幕里面有一些列表项? [英] Android, How to add ScrollView into screen which has some list items?

查看:131
本文介绍了Android的,如何添加滚动型为屏幕里面有一些列表项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的活动,我有三个列表。运行该应用程序后,屏幕不滚动,能。我可以滚动这是对别人的榜首,但​​我不能滚动整个页面。我尝试添加滚动型进入我的XML布局,但皮棉说:在垂直滚动滚动型不应包含另一个垂直滚动窗口小部件(ListView控件)。

in my activity, i have three lists. after running the application, the screen is not scroll-able. i can scroll the list which is on top of others but i can't scroll the whole of page. I tried to add ScrollView into my xml layout but lint says that "The vertically scrolling ScrollView should not contain another vertically scrolling widget (ListView)".

如何使我的屏幕上滚动?

How to make my screen scrollable?

推荐答案

试试这个方法

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

    <LinearLayout android:id="@+id/GlobalLayout" 
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:orientation="vertical" >

        <ListView android:id="@+id/ListView1"
                  android:choiceMode="multipleChoice"
                  android:layout_height="100dip"
                  android:layout_width="fill_parent" />
       <ListView android:id="@+id/ListView2"
                  android:choiceMode="multipleChoice"
                  android:layout_height="100dip"
                  android:layout_width="fill_parent" />
       <ListView android:id="@+id/ListView3"
                  android:choiceMode="multipleChoice"
                  android:layout_height="100dip"
                  android:layout_width="fill_parent" />

    </LinearLayout>

</ScrollView>

这篇关于Android的,如何添加滚动型为屏幕里面有一些列表项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆