1

http://realdevs.tistory.com/entry/asdf

↑ 图片。

我用的时候有问题ListView

由于屏幕已满widgets,我希望ListView的项目与 中的其他项目一起滚动layout

在图片中,蓝色的是布局上的一个小部件,红色的是ListView.

当我向上滚动项目时,它们会移动,但蓝色的不会。

我怎样才能让它一起移动,ListView因为它是 ListView 中的一个项目?

4

3 回答 3

1

你添加你的blue layout作为你的listView标题。

将帮助您添加布局作为标题。

于 2012-07-25T06:18:33.733 回答
0

只需在滚动视图中添加蓝色部分

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

your layout
........


 </ScrollView>
于 2012-07-25T05:54:37.257 回答
0

从您在http://realdevs.tistory.com/entry/asdf中的图片

我在编码xml这个实现。

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical">

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#e0e0e0"
    android:orientation="vertical" >

    <!-- this layout add your other items. I'm exam add Button -->
    <Button
        android:id="@+id/butonTop"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:layout_marginTop="5dp"
        android:text="Top Button" />

</LinearLayout>

<!-- ListView in bottom screen and can auto scroll.  --> 
<ListView
    android:id="@+id/dataListView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:layout_marginTop="5dp"
    android:drawSelectorOnTop="false" >
</ListView>

</LinearLayout>

于 2012-07-25T06:27:58.720 回答