android中关于时间的控件
2024-08-28 13:56:33
1.日期选择器
<DatePicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"></DatePicker>
2.时间选择器
<TimePicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TimePicker>
3.计时器
其中常用的五种方法
(1)setBase() 设置计时器的起始时间
(2)setForma() 设置计时器的显示时间格式
(3)start() 指定开始计时
(4)stop() 指定停止计时
(5)setOnChronometerTickListene() 为计时器绑定事件监听器,当计时器改变时触发该监听器
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"> <Chronometer
android:id="@+id/jishi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:format="以用时间%s"
/> </android.support.constraint.ConstraintLayout>
最新文章
- js 获取当前日期时间3种格式化方法 yyyy-mm-dd hh:MM:ss
- 《构建之法》第8、9、10章 读书笔记和Sprint总结
- :( Call to a member function Table() on a non-object 错误位置
- hadoop 入门实例【转】
- 慕课网-安卓工程师初养成-4-4 Java条件语句之嵌套 if
- gdb 技巧
- Bnuoj-29359 Deal with numbers 线段树
- Google Play和基于Feature的过滤
- IOS开发之----四舍五入问题
- NSIS:应用软件自动升级功能的探索与实践
- MongoDB数据模型(三)
- spring mvc获取绝对路径的几种方法
- 使用genism训练词向量【转载】
- Centos7.3 编译安装GDAL以及Python的GDAL包
- CentOS下使用VirtualBox 安装 Windows虚拟机的简单方法
- Android 屏幕手势滑动中onFling()函数的技巧分析
- Android tesseract-orc之扫描身份证号码
- Android.mk遍历子目录所有文件
- 如何防御mimikatz致敬Mimikatz攻防杂谈学习笔记
- Jmeter(十一)_针对响应信息不明确的接口做关联