2011-07-11 8 views
1

リストビューの後にイメージビューを追加したいと思います。リストビューでは、私は私のxmlファイルelements.so非常に多くを持っている..私は、このXMLファイルに追加したいものを 私を見て、助けてください、このようなものです - > リストビューの後にイメージビューを表示

 <LinearLayout 
      android:id="@+id/search_layout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 
      <AutoCompleteTextView android:id="@+id/autocomplete_country" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_marginLeft="5dp" 
       android:singleLine="true" 
       android:hint="Search"/> 
     </LinearLayout> 

     <!-- <ScrollView android:id="@+id/scrollView1" 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent"> --> 
     <ListView android:id="@+id/listview" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/search_layout" 
      android:layout_centerHorizontal="true" /> 
     <ImageView android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/orbit" 
      android:layout_below="@+id/listview" 

      /> 
     <!-- </ScrollView> --> 

    </RelativeLayout> 
    <!-- </ScrollView> --> 
    <!-- <RelativeLayout android:layout_width="fill_parent" 
    android:layout_height="wrap_content"> --> 

    <!-- </RelativeLayout> --> 
    </LinearLayout> 

答えて

2

あなたImageViewの中で属性android:layout_alignParentBottom="true"を追加し、リストビューにandroid:layout_above="@+id/imageViewId"

+0

おかげでそれはうまく動作します – josarph

+0

これはあなたに役立つ場合に投票してください.. – Sujit

1

Nこれを追加ImageViewをListViewのFooterとして追加する以外は何も私のために働いた。

ImageViewを別のレイアウトファイルに入れてプログラムで膨張させ、フッタービューとしてリストに追加する方がよいでしょう。

View footer = getLayoutInflater().inflate(R.layout.footer_image_view, null); 
listView.addFooterView(footer); 
関連する問題