Android7.0中文文档(API)-- TextClock

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/TextClock.html

TextClock

public class TextClock
extends TextView

java.lang.Object
   ↳android.view.View
    ↳android.widget.TextView
     ↳android.widget.TextClock


TextClock can display the current date and/or time as a formatted string.
TextClock 以一个格式化的字符串来显示当前的日期和/或时间。

This view honors the 24-hour format system setting. As such, it is possible and recommended to provide two different formatting patterns: one to display the date/time in 24-hour mode and one to display the date/time in 12-hour mode. Most callers will want to use the defaults, though, which will be appropriate for the user's locale.
此视图支持24小时格式的系统设置。因此,建议提供两种不同的格式模式:一种是24小时模式显示日期/时间,另一种是12小时模式显示日期/时间。不过,大多数调用者都会使用默认值,有用户的区域设置来决定显示格式。

It is possible to determine whether the system is currently in 24-hour mode by calling is24HourModeEnabled().
可以通过调用is24HourModeEnabled()来确定系统当前是否处于24小时模式下。

The rules used by this widget to decide how to format the date and time are the following:
决定这个控件使用何种格式化日期和时间的规则如下:

  • 24小时模式:
  • 12小时模式:

The CharSequence instances used as formatting patterns when calling either setFormat24Hour(CharSequence) or setFormat12Hour(CharSequence) can contain styling information. To do so, use a Spanned object. Note that if you customize these strings, it is your responsibility to supply strings appropriate for formatting dates and/or times in the user's locale.
当调用setFormat24Hour(CharSequence)setFormat12Hour(CharSequence)可以包含显示的样式信息,其中CharSequence对象参数用于格式化模式。因此,需要一个Spanned对象。请注意,你如果自定义了这些字符串,则你有责任为用户区域设置中的格式化的日期和/或事件提供合适的字符串。

摘要


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值