Android电话短信拦截项目总结之 项目中线性布局比重使用

来源:互联网 发布:centos 防止ddos 编辑:程序博客网 时间:2024/04/30 07:47

效果图:


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    android:orientation="vertical" >


    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:hint="按名称,电话号码搜索"
        android:background="@drawable/title_bar_bg"
        />
     <!-- layout_weight默认值是0,ListView是1,其他两个布局是0 -->


    <ListView
        android:id="@+id/listView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:layout_weight="1"
        >
    </ListView>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
         >
          <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="添加"
        />


    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="删除"
         />
         
    </LinearLayout>


   


</LinearLayout>
0 0
原创粉丝点击