随笔 - 403  文章 - 0  评论 - 6  阅读 - 3254

2月26

android应用页面主界面

界面代码

复制代码
<?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="match_parent"
    tools:context=".MainActivity">

    <Button
        android:id="@+id/btnPickDate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="选择日期"
        android:onClick="showDatePicker"
        android:layout_toRightOf="@id/tv_month_and_balance" />


    <TextView
        android:id="@+id/tv_month_and_balance"
        android:layout_width="300dp"
        android:layout_height="40dp"
        android:layout_centerHorizontal="true"
        android:textSize="20sp"
        android:layout_alignParentLeft="true"
        android:textColor="#000000" />

    <ListView
        android:id="@+id/list_view"
        android:layout_width="wrap_content"
        android:layout_height="500dp"
        android:layout_below="@+id/btnPickDate"/>

    <ImageButton
        android:id="@+id/add"
        android:onClick="addAccount"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:scaleType="centerInside"
        android:layout_centerHorizontal="true"
        android:background="#ffffff"
        android:src="@drawable/tianjia"
        android:layout_below="@+id/list_view" />


</RelativeLayout>
复制代码

添加界面

 界面代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?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"
    android:gravity="center">
    <EditText
        android:id="@+id/et_cost"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_margin="4dp"
        android:hint="事件类型"
        android:textColor="#ffbd27"
        />
    <EditText
        android:id="@+id/et_cost_title"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_margin="4dp"
        android:hint="备注"
        android:textColor="#ffbd27"
       />
 
 
 
    <EditText
        android:id="@+id/et_cost_money"
        android:inputType="number|numberDecimal"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_margin="4dp"
        android:hint="花费的金额"
        android:textColor="#ffbd27"
         />
 
 
    <DatePicker
        android:id="@+id/dp_cost_date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="8dp"
        android:datePickerMode="spinner"
        android:calendarViewShown="false"
        />
 
    <Button
        android:onClick="okButton"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="确认"
        android:textSize="20dp"
        android:textColor="#ffd700"
        android:background="#ffd700"
        android:layout_marginLeft="40dp"
        android:layout_marginRight="40dp"
        />
</LinearLayout>

  日期选择器调用用来选择日期从而计算每天的余额。

 

posted on   石铁生  阅读(8)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 终于写完轮子一部分:tcp代理 了,记录一下
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示