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>

android中关于时间的控件的更多相关文章

  1. android中一个评分的控件

    RatingBar android中一个评分的控件 如何使用 Android Studio下: dependencies { compile 'com.hedgehog.ratingbar:app:1 ...

  2. Android中的自定义视图控件

    简介 当现有控件不能满足需求时,就需要自定义控件. 自定义控件属性 自定义控件首先要继承自View,重写两个构造函数. 第一个是代码中使用的: public MyRect(Context contex ...

  3. Android中使用shape来定义控件

    本文章转接于:http://kofi1122.blog.51cto.com/2815761/521605 Android中常常使用shape来定义控件的一些显示属性,今天看了一些shape的使用,对s ...

  4. android中的五大布局(控件的容器,可以放button等控件)

    一.android中五大布局相当于是容器,这些容器里可以放控件也可以放另一个容器,子控件和布局都需要制定属性. 1.相对布局:RelativeLayout @1控件默认堆叠排列,需要制定控件的相对位置 ...

  5. layer过去的时间不能选择,只能选择未来的时间 LayUI中的时间日期控件,设置时间范围,

    默认Layui中的时间控件显示如下: 我当时系统时间是2018-06-07, 我需要做的是2018-06-07之后过去的时间不能选择 <p><span>时间范围:</sp ...

  6. android 中通过代码创建控件

    package bvb.de.openadbwireless.circle; import android.annotation.TargetApi; import android.app.Activ ...

  7. winform中的时间轴控件

    我现在做的项目遇到一个需求,就是有没有类似的控件: 我要实现的功能是:播放录像. 某个时间段内假如有2个录像,这个坐标表示的是时间,假如我现在拖动时间轴,拖到第一个录像里面开始播放第一个录像,拖到2个 ...

  8. Android进阶篇-时间滑动控件

    仿Iphone时间选择滑动控件: WheelView.java: /** * @author Administrator * * 时间滑动滚轮 */ public class WheelView ex ...

  9. android中动态修改ImageView控件的宽高度

    本例实现了动态修改ImageView控件的宽高度,有两个按钮,一个按钮实现放大image,一个按钮实现缩小image activity_main.xml <?xml version=" ...

随机推荐

  1. Android Studio中Gradle sync failed

    问题:Android Studio中更新同步Gradle 失败 Gradle sync failed: Could not find com.android.tools.build:gradle:3. ...

  2. django中navie time 和 aware time的使用和转换

    在django中有关时间被分为navie time 和 aware time两种,前者指的是不带时区标记的时间格式,后者被认为是带有时区标记的时间格式.在django框架的setting.py文件中 ...

  3. TLS使用指南(一):如何在Rancher 2.x中进行TLS termination?

    引 言 这是一个系列文章,我们将在本系列中探索Rancher使用TLS证书的不同方式.TLS,安全传输层协议,是用于保护网络通信的加密协议.它是目前已经弃用的安全套接层(SSL)的继任者. 你可以从本 ...

  4. 场景6:具有OpenvSwitch的提供商网络

    此场景描述了使用带有Open vSwitch(OVS)的ML2插件的OpenStack网络服务的提供者网络实现. 在OpenStack网络引入分布式虚拟路由器之前,所有网络通信都通过一个或多个专门的网 ...

  5. 第一节——词向量与ELmo(转)

    最近在家听贪心学院的NLP直播课.都是比较基础的内容.放到博客上作为NLP 课程的简单的梳理. 本节课程主要讲解的是词向量和Elmo.核心是Elmo,词向量是基础知识点. Elmo 是2018年提出的 ...

  6. Flink与HanLP集成使用

    自然语言处理是机器学习的一个重要分支,在智能翻译.智能问答.舆情监控.ChatOps等都有很好的应用场景,目前比较好的一个开源实现工具是何晗大神的HanLP,主页(http://hanlp.com/) ...

  7. what can we do if just only want to truncate transaction log without backup ?

    n some circumstances, we just want to truncate transaction log without backup and refuce change data ...

  8. The related functions and attributes for managing attributes - 操作属性的重要属性和函数

    特性 property 都是类属性(静态变量),但是特性管理的其实是实例属性的存取, ****** 回顾 -'类方法' classmethod 和 '静态方法' staticmethod 皆可以访问类 ...

  9. HttpClient学习整理(一)

    Http协议的重要性相信不用我多说了,HttpClient相比传统JDK自带的URLConnection,增加了易用性和灵活性(具体区别,日后我们再讨论),它不仅是客户端发送Http请求变得容易,而且 ...

  10. LVS 介绍 原理

    一. LVS简介       LVS是Linux Virtual Server的简称,也就是Linux虚拟服务器, 是一个由章文嵩博士发起的自由软件项目,它的官方站点是www.linuxvirtual ...