进度2_家庭记账本App

今天在昨天的基础上,相继完成了三个页面的布局和显示情况:

新增加的xml文件如下:

activity_add.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center">

  <EditText
      android:id="@+id/et_cost_title"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_margin="4dp"
      android:hint="花费名称"/>

    <EditText
        android:id="@+id/et_cost_money"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="4dp"
        android:hint="花费金额"/>

    <DatePicker
        android:id="@+id/dp_cost_date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="4dp"
        android:datePickerMode="spinner"
        android:calendarViewShown="false"/>

    <LinearLayout
        android:id="@+id/btn"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:layout_gravity="center"
        android:orientation="horizontal">
        <Button
            android:id="@+id/btn_return"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="返回"
            android:background="#87CEFA"
            android:layout_marginLeft="90dp"
            />
        <Button
            android:id="@+id/btn_go"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="确认"
            android:background="#87CEFA"
            android:layout_marginLeft="50dp" />
    </LinearLayout>


    </LinearLayout>

activity_look.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="80dp"
    android:orientation="vertical">

    <TextView
        android:id="@+id/tv_title"
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:gravity="center"
        android:singleLine="true"
        android:textSize="30sp"
        android:ellipsize="marquee"
        android:text="花费名称"/>

    <TextView
        android:id="@+id/tv_data"
        android:layout_width="wrap_content"
        android:layout_height="80dp"
        android:gravity="center"
        android:textSize="20sp"
        android:layout_marginLeft="15dp"
        android:layout_toRightOf="@id/tv_title"
        android:text="花费日期"/>

    <TextView
        android:id="@+id/tv_cost"
        android:layout_width="wrap_content"
        android:layout_height="80dp"
        android:gravity="center"
        android:layout_alignParentRight="true"
        android:layout_marginRight="20dp"
        android:text="00.00"
        android:textSize="25sp"/>
</RelativeLayout>

activity_setting.xml:

<?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">

    <TextView
        android:id="@+id/usname"
        android:layout_marginTop="100dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:text="账户名:"
        android:textColor="#000"
        android:textSize="20dp" />
    <EditText
        android:id="@+id/usname_"
        android:layout_alignBottom="@+id/reg_number1"
        android:layout_toRightOf="@+id/reg_number1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="请输入账户名"
        android:padding="10dp" />

    <TextView
        android:layout_marginTop="60dp"
        android:id="@+id/reg_number1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="20dp"
        android:text="密码:"
        android:textColor="#000"
        android:textSize="20dp" />
    <EditText
        android:layout_alignBottom="@+id/reg_number1"
        android:layout_toRightOf="@+id/reg_number1"
        android:id="@+id/reg_username"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="请输入密码:"
        android:padding="10dp" />

    <LinearLayout
        android:id="@+id/btn_setting_"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:layout_gravity="center"
        android:orientation="horizontal">
        <Button
            android:id="@+id/btn_return"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="更改密码"
            android:background="#87CEFA"
            android:layout_marginLeft="90dp"
            />
        <Button
            android:id="@+id/btn_go"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="退出登录"
            android:background="#87CEFA"
            android:layout_marginLeft="50dp" />
    </LinearLayout>

</LinearLayout>

运行结果:

猜你喜欢

转载自www.cnblogs.com/hhjing/p/12264705.html