1

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

↑写真。

使用時に問題がありますListView

画面が でいっぱいなので、のアイテムを の他のアイテムと一緒にスクロールできるwidgetsようにしたいと思います。ListViewlayout

写真上、青いのがレイアウト上のウィジェット、赤いのが のアイテムですListView

アイテムを上にスクロールすると移動しますが、青いアイテムは移動しません。

ListViewListViewの項目なので一緒に移動するにはどうすればいいですか?

4

3 に答える 3

1

あなたはあなたのヘッダーblue layoutとしてあなたを追加します。listView

これは、ヘッダーとしてレイアウトを追加するのに役立ちます。

于 2012-07-25T06:18:33.733 に答える
0

その青い部分をscrollviewに追加するだけです

 <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 に答える