zoukankan      html  css  js  c++  java
  • 家庭记账本开发记录5

    为了能够显示数据库中的信息,需要引入listview布局。

    listview.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/text1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="2dp"
        android:background="@drawable/text_view_shape"
        android:textColor="@color/black"
        android:textSize="20sp" />

    主页面的布局:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
    
            <TextView
                android:id="@+id/spend_count"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/spend"
                android:textColor="@color/black"
                android:textSize="50sp" />
    
            <TextView
                android:id="@+id/spend_money"
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="20dp"
                android:layout_toRightOf="@+id/spend_count"
                android:gravity="center_vertical"
                android:textColor="@color/black"
                android:textSize="30sp" />
    
        </RelativeLayout>
    
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
    
            <TextView
                android:id="@+id/income_count"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/income"
                android:textColor="@color/black"
                android:textSize="50sp" />
    
            <TextView
                android:id="@+id/income_money"
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="20dp"
                android:layout_toRightOf="@id/income_count"
                android:gravity="center_vertical"
                android:textColor="@color/black"
                android:textSize="30sp" />
    
        </RelativeLayout>
    
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
    
            <TextView
                android:id="@+id/count_t"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/count"
                android:textColor="@color/black"
                android:textSize="50sp" />
    
            <TextView
                android:id="@+id/count"
                android:layout_width="150dp"
                android:layout_height="50dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="20dp"
                android:layout_toRightOf="@id/count_t"
                android:gravity="center_vertical"
                android:textColor="@color/black"
                android:textSize="30sp" />
    
        </RelativeLayout>
    
        <ListView
            android:id="@+id/list_view1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    
    
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center|bottom"
            android:layout_weight="1">
    
            <Button
                android:id="@+id/income_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:textSize="20sp"
                android:text="收入" />
    
            <Button
                android:id="@+id/spend_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:textSize="20sp"
                android:layout_marginLeft="20dp"
                android:layout_toRightOf="@id/income_btn"
                android:text="支出" />
        </RelativeLayout>
    </LinearLayout>
  • 相关阅读:
    MySQL binlog中 format_desc event格式解析
    位bit和字节Byte
    MySQL利用mysqlbinlog模拟增量恢复
    mysqldump参数 --master-data详解
    开启MySQL二进制日志
    设置花里胡哨的Xshell字体与背景颜色(超全)
    Python操作MySQL数据库
    给定一个由括号([{)]}其中之一或多个组成的字符串判断是否符合左右括号成对标准,不同括号可任意嵌套
    给定一个字符串str,将str中连续两个字符为a的字符替换为b(一个或连续超过多个字符a则不替换)
    不使用局部变量和for循环或其它循环打印出如m=19,n=2結果为2 4 8 16 16 8 4 2形式的串
  • 原文地址:https://www.cnblogs.com/MXming/p/14916033.html
Copyright © 2011-2022 走看看