一些布局文件

来源:互联网 发布:linux查ip地址命令 编辑:程序博客网 时间:2024/06/14 18:24

1.ShowContacts

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent" >        <TextView        android:id="@+id/tv_user"         android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:textSize="30sp"        android:layout_centerHorizontal="true"        />        <Button         android:id="@+id/btn_addcontacts"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_centerHorizontal="true"        android:layout_alignParentBottom="true"        android:text="@string/btn_add"        />    <ListView         android:id="@+id/lv"        android:layout_below="@id/tv_user"        android:layout_width="match_parent"        android:layout_height="match_parent"        android:layout_above="@id/btn_addcontacts"></ListView></RelativeLayout>

2.Login

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical" >    <TextView        android:id="@+id/tv_login"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/login"        android:textSize="30sp"         android:layout_centerHorizontal="true"        android:layout_marginTop="50dp"/>    <RelativeLayout android:layout_width="match_parent"        android:id="@+id/rl_username"        android:layout_below="@id/tv_login"        android:layout_height="wrap_content"         android:layout_marginTop="30dp"        android:layout_marginLeft="50dp"        android:layout_marginRight="50dp" >        <TextView android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:id="@+id/tv_username"            android:text="@string/username"            android:textSize="20sp"/>        <EditText android:id="@+id/et_username"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_toRightOf="@id/tv_username"            android:hint="@string/hint_un"            />    </RelativeLayout>    <RelativeLayout android:layout_width="match_parent"        android:id="@+id/rl_password"        android:layout_below="@id/rl_username"        android:layout_height="wrap_content"         android:layout_marginTop="30dp"        android:layout_marginLeft="50dp"        android:layout_marginRight="50dp" >        <TextView android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:id="@+id/tv_password"            android:text="@string/password"            android:textSize="20sp"/>        <EditText android:id="@+id/et_password"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_toRightOf="@id/tv_password"            android:inputType="textPassword"            android:hint="@string/hint_psw"            />    </RelativeLayout>        <Button         android:id="@+id/btn_login"        android:layout_below="@id/rl_password"        android:layout_marginTop="20dp"        android:layout_centerHorizontal="true"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/btn_login"        /></RelativeLayout>

3.List_item

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical" >    <TableLayout         android:layout_width="match_parent"        android:layout_height="wrap_content"        android:shrinkColumns="0"        android:stretchColumns="1">        <TableRow             android:layout_width="wrap_content"            android:layout_height="wrap_content">            <TextView                 android:id="@+id/tv_xm"                android:textSize="25sp"                />        </TableRow>        <TableRow             android:layout_width="wrap_content"            android:layout_height="wrap_content">            <TextView                 android:id="@+id/tv_dh"                android:textSize="20sp"                />            <TextView                 android:id="@+id/tv_dz"                android:gravity="right"                />        </TableRow>    </TableLayout></RelativeLayout>

4.AddContacts

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent" >    <TextView        android:id="@+id/tv_add"         android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/btn_add"        android:textSize="30sp"        android:layout_centerHorizontal="true"        android:layout_marginTop="20dp"        />    <TableLayout         android:id="@+id/tl"        android:layout_below="@id/tv_add"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_marginLeft="20dp"        android:layout_marginRight="20dp"        android:layout_marginTop="20dp"        android:shrinkColumns="0"        android:stretchColumns="1">        <TableRow             android:layout_width="match_parent"            android:layout_height="wrap_content">            <TextView                 android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="@string/add_xm"/>            <EditText                 android:id="@+id/et_xm"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:hint="@string/hint_xm"/>        </TableRow>        <TableRow             android:layout_width="match_parent"            android:layout_height="wrap_content">            <TextView                 android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="@string/add_dh"/>            <EditText                 android:id="@+id/et_dh"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:hint="@string/hint_dh"/>        </TableRow>        <TableRow             android:layout_width="match_parent"            android:layout_height="wrap_content">            <TextView                 android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="@string/add_dz"/>            <EditText                 android:id="@+id/et_dz"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:hint="@string/hint_dz"/>        </TableRow>    </TableLayout>    <Button         android:id="@+id/btn_ok"        android:layout_below="@id/tl"        android:layout_marginTop="20dp"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_centerHorizontal="true"        android:text="@string/btn_ok"/></RelativeLayout>

5.strings

<?xml version="1.0" encoding="utf-8"?><resources>    <string name="app_name">FinalTest</string>    <string name="action_settings">Settings</string>    <string name="hello">欢迎界面</string>    <string name="login">请登录</string>    <string name="username">用户名:</string>    <string name="password">密     码:</string>    <string name="hint_un">请输入用户名</string>    <string name="hint_psw">请输入密码</string>    <string name="btn_login">登录</string>    <string name="btn_add">添加联系人</string>    <string name="add_xm">姓名:</string>    <string name="add_dh">电话:</string>    <string name="add_dz">地址:</string>    <string name="hint_xm">请输入姓名</string>    <string name="hint_dh">请输入电话</string>    <string name="hint_dz">请输入地址</string>    <string name="btn_ok">点击添加</string></resources>
原创粉丝点击