listView后面加控件,防止被挤

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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="@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="@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后面加控件,防止被挤的主要内容,如果未能解决你的问题,请参考以下文章

winform listview控件容器控件

ListView添加节点

c#将list集合直接绑定到listview控件

c#listview添加控件时不显示滚动条

C# winform 控件拖动问题

C# winform ListView+CheckBox的做法