首页 > 代码库 > listView后面加控件,防止被挤

listView后面加控件,防止被挤

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   
android:orientation="vertical"
   
android:layout_width="match_parent"
   
android:layout_height="match_parent"
   
android:background="@color/content_blackground"

   
>
    <RelativeLayout
       
android:id="@+id/search_bar_layout"
       
android:layout_width="match_parent"
       
android:layout_height="48dp"
        
android:layout_margin="10dp"
          
>
        <TextView
            
android:id="@+id/btn_search_around"
           
android:layout_width="wrap_content"
           
android:layout_height="match_parent"
           
android:layout_alignParentEnd="true"
           
android:layout_alignParentRight="true"
           
android:layout_centerVertical="true"
           
android:background="@drawable/map_search_btn"
            
android:gravity="center"
           
android:padding="12dp"
           
android:text="搜索"
            
android:textColor="@color/white"
           
android:textSize="12dp"/>
        <ImageView
           
android:id="@+id/img_back"
           
android:layout_width="20dp"
           
android:layout_height="20dp"
           
android:src=http://www.mamicode.com/"@drawable/back_gray"
           
android:layout_alignParentLeft="true"
           
android:layout_centerVertical="true"
           
android:layout_marginRight="10dp"
            
/>
        <LinearLayout
           
android:layout_width="match_parent"
           
android:layout_height="match_parent"
           
android:layout_centerVertical="true"
           
android:orientation="horizontal"
           
android:layout_toRightOf="@id/img_back"
           
android:layout_toLeftOf="@+id/btn_search_around"
           
android:background="@drawable/search_input_half"
            
android:gravity="center_vertical" >
            <AutoCompleteTextView
               
android:id="@+id/input_edittext"
               
android:layout_width="0dp"
               
android:layout_weight="2"
               
android:layout_height="match_parent"
               
android:drawableLeft="@drawable/search_input"
               
android:background="@color/transparent"
               
android:hint="请输入搜索关键字"
               
android:textColorHint="@color/check_gray"
               
android:singleLine="true"
               
android:textColor="@color/check_gray"
               
android:textSize="14sp" />
            <ImageView
               
android:id="@+id/img_clear"
               
android:layout_width="18dp"
               
android:layout_height="18dp"
               
android:src=http://www.mamicode.com/"@drawable/common_input_box_clear"
               
android:layout_marginRight="5dp"/>
        </LinearLayout>
    </RelativeLayout>

    <LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="wrap_content"
       
android:orientation="vertical">
        <ListView
           
android:id="@+id/lv_record"
           
android:layout_marginTop="20dp"
           
android:layout_width="match_parent"
           
android:layout_height="0dp"
           
android:layout_weight="1"
           
>
        </ListView>
        <LinearLayout
           
android:id="@+id/ll_clear"
           
android:layout_width="match_parent"
            
android:orientation="vertical"
           
android:layout_height="wrap_content"
           
android:layout_weight="0"
           
>
            <View
               
android:layout_width="match_parent"
               
android:layout_height="1px"
               
android:background="@color/main_view_split_line_color"
               
/>
            <TextView
               
android:id="@+id/tv_clear"
               
android:layout_width="match_parent"
               
android:layout_height="wrap_content"
               
android:text="清空历史记录"
               
android:textSize="@dimen/word_small"
               
android:textColor="@color/check_gray"
               
android:padding="10dp"
               
android:gravity="center"
               
android:layout_marginBottom="10dp"
               
android:background="@color/white"
               
/>
        </LinearLayout>

    </LinearLayout>


</LinearLayout>

listView后面加控件,防止被挤