Android7.0中文文档(API)-- TextClock
2017-06-12 23:47
911 查看
完整内容,请查看: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 |
TextClockcan 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小时模式:
使用
getFormat24Hour()返回的非空值
否则,使用
getFormat12Hour()返回的非空值
否则使用用户的区域设置的默认值,如:
h:mm a
12小时模式:
使用
getFormat12Hour()返回的非空值
否则,使用
getFormat24Hour()返回的非空值
否则使用用户的区域设置的默认值,如:
HH:mm
The
CharSequenceinstances used as formatting patterns when calling either
setFormat24Hour(CharSequence)or
setFormat12Hour(CharSequence)can contain styling information. To do so, use a
Spannedobject. 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对象。请注意,你如果自定义了这些字符串,则你有责任为用户区域设置中的格式化的日期和/或事件提供合适的字符串。
摘要
相关文章推荐
- Android7.0中文文档(API)--- DatePicker
- Android7.0中文文档(API)--- AbsoluteLayout
- Android7.0中文文档(API)-- TextSwitcher
- Android7.0中文文档(API)--- AutoCompleteTextView
- Android7.0中文文档(API)--- ViewSwitcher
- Android7.0中文文档(API) --- MediaController
- Android7.0中文文档(API)---Chronometer
- Android7.0中文文档(API)-- StackView
- Android7.0中文文档(API)--- AdapterViewAnimator
- Android7.0中文文档(API)--- ExpandableListView
- Android7.0中文文档(API) -- TimePicker
- Android7.0中文文档(API) --- Button
- Android7.0中文文档(API) --- ToggleButton
- Android7.0中文文档(API)--- VideoView
- Android7.0中文文档(API)--- FrameLayout
- Android7.0中文文档(API)-- ViewAnimator
- Android7.0中文文档(API) --- CheckedTextView
- Android7.0中文文档(API) -- ScrollView
- Android7.0中文文档 (API)--- QuickContactBadge
- Android7.0中文文档(API)--- ViewFlipper