2011-07-11 47 views
1

我想在listview之後添加imageview。在列表視圖中我有這麼多elements.so我的XML文件是這樣的,請看看,並幫助我,我想在這個XML文件中添加什麼.. - > 在列表視圖後顯示imageview

 <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> 

在您的ImageView

回答

2

附加屬性android:layout_alignParentBottom="true",並在您的ListView android:layout_above="@+id/imageViewId"

+0

所以謝謝它將工作正常 – josarph

+0

請投票,如果這對你有幫助.. – Sujit

1

ñ添加此沒有爲我工作,除了添加ImageView作爲ListView的Footer

最好將ImageView放在一個單獨的佈局文件中,然後以編程方式膨脹它並將其作爲頁腳視圖添加到列表中。

View footer = getLayoutInflater().inflate(R.layout.footer_image_view, null); 
listView.addFooterView(footer);