Android记账本界面实现
<!--activity_main.xml-->
1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent"
6 android:layout_height="match_parent"
7 tools:context=".MainActivity">
8
9 <com.google.android.material.appbar.AppBarLayout
10 android:layout_width="match_parent"
11 android:layout_height="wrap_content"
12 android:theme="@style/Theme.Mooc.AppBarOverlay">
13
14 <androidx.appcompat.widget.Toolbar
15 android:id="@+id/toolbar"
16 android:layout_width="match_parent"
17 android:layout_height="?attr/actionBarSize"
18 android:background="?attr/colorPrimary"
19 app:popupTheme="@style/Theme.Mooc.PopupOverlay" />
20
21 </com.google.android.material.appbar.AppBarLayout>
22 <include layout="@layout/content_main" />
23
24 <com.google.android.material.floatingactionbutton.FloatingActionButton
25 android:id="@+id/fab"
26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content"
28 android:layout_gravity="bottom|end"
29 android:layout_margin="@dimen/fab_margin"
30 app:srcCompat="@android:drawable/ic_dialog_info" />
31 </androidx.coordinatorlayout.widget.CoordinatorLayout>
<!--content_main.xml-->
1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 android:layout_width="match_parent"
5 android:layout_height="match_parent"
6 app:layout_behavior="@string/appbar_scrolling_view_behavior">
7
8 <fragment
9 android:id="@+id/nav_host_fragment"
10 android:name="androidx.navigation.fragment.NavHostFragment"
11 android:layout_width="0dp"
12 android:layout_height="0dp"
13 app:defaultNavHost="true"
14 app:layout_constraintBottom_toBottomOf="parent"
15 app:layout_constraintLeft_toLeftOf="parent"
16 app:layout_constraintRight_toRightOf="parent"
17 app:layout_constraintTop_toTopOf="parent"
18 app:navGraph="@navigation/nav_graph" />
19 <ListView
20 android:layout_width="match_parent"
21 android:layout_height="match_parent"
22 android:id="@+id/lv_main"
23 />
24 </androidx.constraintlayout.widget.ConstraintLayout>
<!--list_item.xml-->
1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent"
4 android:layout_height="match_parent">
5 <TextView
6 android:id="@+id/tv_title"
7 android:layout_width="100dp"
8 android:layout_height="80dp"
9 android:layout_marginLeft="10dp"
10 android:gravity="center"
11 android:singleLine="true"
12 android:textSize="20sp"
13 android:ellipsize="marquee"
14 android:text="costTitle"
15 />
16 <TextView
17 android:id="@+id/tv_date"
18 android:layout_width="wrap_content"
19 android:layout_height="80dp"
20 android:gravity="center"
21 android:textSize="20sp"
22 android:layout_marginLeft="25dp"
23 android:layout_toRightOf="@+id/tv_title"
24 android:text="costDate"
25 />
26
27 <TextView
28 android:layout_width="wrap_content"
29 android:layout_height="80dp"
30 android:id="@+id/tv_cost"
31 android:layout_alignParentRight="true"
32 android:textSize="39sp"
33 android:text="60"
34 />
35 </RelativeLayout>
Android记账本界面实现的更多相关文章
- 解决Android Graphical Layout 界面效果不显示
解决Android Graphical Layout 界面效果不显示 qq463431476
- Android之拨号界面图片风格,无信息默认显示界面修改
Android之拨号界面图片风格,无信息默认显示界面修改 点开Dialer app,出现拨号,联系人,收藏三个选项卡,也就是三个Fragment,在三个界面都没有信息的时候会显示一个时钟,联系人,收藏 ...
- Android实现入门界面布局
Android实现入门界面布局 开发工具:Andorid Studio 1.3 运行环境:Android 4.4 KitKat 代码实现 首先是常量的定义,安卓中固定字符串应该定义在常量中. stri ...
- Android的配置界面PreferenceActivity
我想大家对于android的系统配置界面应该不会陌生吧,即便陌生,那么下面的界面应该似曾相识吧,假若还是不认识,那么也没有关系,我们这一节主要就是介绍并讲解android 中系统配置界面的使用,相信大 ...
- 图解android开发在界面上显示图片
图解android开发在界面上显示图片<申明:转自百度> <原文章地址:http://jingyan.baidu.com/article/49711c6153a277fa441b7c ...
- Android——实现欢迎界面的自动跳转(转)
Android实现欢迎界面的自动跳转,就是打开某一个安卓手机应用,出现的欢迎界面停留几秒钟,自动进入应用程序的主界面.在网上看到很多种实现办法,但是感觉这种方法还是比较简单的. 在onCreate里设 ...
- 二、Android应用的界面编程(七)ViewAnimator及其子类[ ViewSwitcher、ImageSwitcher、TextSwitcher、ViewFlipper ]
ViewAnimator是一个基类,它继承了FrameLayout.因此它表现出FrameLayout的特征,可以将多个View组“叠”在一起. ViewAnimator可以在View切换时表现出动画 ...
- Android开发自学笔记(Android Studio)—4.界面编程与View组件简单介绍
一.引言 Android应用开发最重要的一份内容就是界面的开发,无论你程序包含的内容多么优秀,如若没有一个良好的用户交互界面,最终也只是会被用户所遗弃.Android SDK提供了大量功能丰富的UI组 ...
- Android 设置启动界面
启动界面的意义是为了让后台处理耗时的复杂工作,当工作处理完成后,即可进入主界面.相比让用户等待布局加载完成,使用一张图片作为启动背景,会带来更好的体验. 首先,需要建立一个简单的布局: <?xm ...
- Android实现Banner界面广告图片循环轮播(包括实现手动滑动循环)
前言:经常会看到有一些app的banner界面可以实现循环播放多个广告图片和手动滑动循环.本以为单纯的ViewPager就可以实现这些功能.但是蛋疼的事情来了,ViewPager并不支持循环翻页.所以 ...
随机推荐
- 溯源反制-Mysql蜜罐
东西比较老,类似的文章网上已经很多,原理主要是通过服务端的load data动作可以主动向客户端获取文件. 看过hfish等自带的mysql蜜罐读取/etc/passwd,感觉还差点实用性.这次文章主 ...
- golang中协程&管道&锁
进程和线程 进程(Process)就是程序在操作系统中的一次执行过程,是系统进行资源分配和调度的基 本单位,进程是一个动态概念,是程序在执行过程中分配和管理资源的基本单位,每一个进 程都有一个自己的地 ...
- djang中文件上传MEDIA路径配置
1.settings.py文件中配置 # 项目中存储上传文件的根目录[暂时配置],注意,uploads目录需要手动创建否则上传文件时报错 MEDIA_ROOT = os.path.join(BASE_ ...
- SpringBoot面试题的零碎整理
面试题1:简述一下Springboot相对SSM做了哪些提升? 首先,SpringBoot是采用"约定大于配置"(Convention over Configuration)的理念 ...
- 【Azure事件中心】使用Python SDK(Confluent)相关方法获取offset或lag时提示SSL相关错误
问题描述 使用Python SDK(Confluent)相关方法获取offset或lag时, 提示SSL相关错误, 是否有更清晰的实例以便参考呢? 问题解决 执行代码,因为一直连接不成功,所以检查 c ...
- C#实现图片对比
前言 虽然已经正式转JAVA了,但最近发现一个特别好的开源项目masuit,不仅提供很多简便的功能,还有图像的一些特殊操作功能. 下面就实现一个简单图像对比. 实现对比 代码如下,实现一个可以对比翻转 ...
- Python中那些简单又好用的特性和用法
Python作为我的主力语言帮助我开发了许多DevOps运维自动化系统,这篇文章总结几个我在编写Python代码过程中用到的几个简单又好用的特性和用法,这些特性和用法可以帮助我们更高效地编写Pytho ...
- 牛客周赛 Round 31(A~F)
目录 A B C D E F A #include <bits/stdc++.h> #define int long long #define rep(i,a,b) for(int i = ...
- 基于bes2300 的六轴传感器mpu6050调试总结
需求 在医疗健康领域,有很多场景需要分析佩戴者的姿势和动作.mpu6050多轴传感器是一个不二的选择.假如想把功耗做的低一些,放在耳机里,bes2300芯片配合mpu6050是一个不错的选择.遗憾的 ...
- Rust 标准库 Trait 指南
部分内容来自 Rust 2021 年期刊 内容目录 引言 Trait 基础 自动 Trait 泛型 Trait 格式化 Trait 操作符 Trait 转换 Trait 错误处理 迭代器 Trait ...