2011-07-11 44 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);