zoukankan      html  css  js  c++  java
  • android中关于时间的控件

    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>

  • 相关阅读:
    几种简单的博弈 1
    Luogu P2789 直线交点数
    搜索题简记
    并查集的妙用
    [qbzt寒假]线段树和树状数组
    [qbzt寒假]hash
    [qbzt寒假]Trie字典树
    博客阅读须知
    洛谷P1842 [USACO05NOV]奶牛玩杂技——题解
    2020SDOI游记
  • 原文地址:https://www.cnblogs.com/zwx655/p/12288334.html
Copyright © 2011-2022 走看看