2011-03-24 12 views
1

私はそれぞれのレイアウトにヘッダーを追加しています。これまでのところリストビューになるまでうまくいきました。リストビューは表示されません。Includeを使用した後でListViewが表示されない

<?xml version="1.0" encoding="utf-8"?> 
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" android:layout_height="fill_parent" 
     android:background="#FFFFFF"> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"> 
     <include android:id="@+id/headerbar" layout="@layout/header" 
       android:layout_height="wrap_content" android:layout_width="fill_parent" /> 
     <ListView android:id="@+id/android:list" 
      android:layout_weight="1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"/> 
     <TextView android:id="@+id/android:empty" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/nothin"/> 
    </LinearLayout> 
    </ScrollView> 

私はまた、0dpの高さを与えようとしましたが、これはどちらも失敗しました。誰にもアイデアはありますか?

編集は:相続いただきまし含まれている:

<LinearLayout android:id="@+id/header" 
    android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/headerbg" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 
    <ImageButton 
     android:id="@+id/headerButton" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/header" 
     android:background="@null"></ImageButton> 
</LinearLayout> 

答えて

2

要素を積み重ねる方法を知るために、線図レイアウトの向きプロパティを設定する必要があります。

0

が、それはこのように画面全体および残りのためのスペースを一切使用してandroid:layout_height="fill_parent"headerを持っているあなたの問題ではありませんか? これが当てはまらない場合は、layoutsの両方のマージ方法を表示できますか?

関連する問題