您的位置:首页 > 移动开发 > Android开发

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

2017-06-08 16:24 417 查看

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

TimePicker

public class TimePicker

extends

FrameLayout


java.lang.Object
   ↳android.view.View
    ↳android.view.ViewGroup
     ↳android.widget.FrameLayout
      ↳android.widget.TimePicker
A widget for selecting the time of day, in either 24-hour or AM/PM mode.

一个选择时间的控件,24小时模式或AM/PM模式。

For a dialog using this view, see
TimePickerDialog
. See the

Pickers guide for more information.

使用此视图的一个对话框,请参考
TimePickerDialog
。请参考Pickers指南获取更多信息。

摘要

嵌套类

interface
TimePicker.OnTimeChangedListener

The callback interface used to indicate the time has been adjusted. 

回调接口,用于表明时间已经被调整。 

XML属性

android:timePickerMode
设定widget的外观。 

继承XML属性



From
class
android.widget.FrameLayout




From
class
android.view.ViewGroup




From
class
android.view.View


继承常量



From
class
android.view.ViewGroup




From
class
android.view.View


继承字段



From
class
android.view.View


Public构造方法

TimePicker(Context
context)
TimePicker(Context
context,
AttributeSet attrs)
TimePicker(Context
context,
AttributeSet attrs, int defStyleAttr)
TimePicker(Context
context,
AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public方法

CharSequence
getAccessibilityClassName()

Return the class name of this object to be used for accessibility purposes.

返回此对象的类名,用于辅助功能目的。

int
getBaseline()

Return the offset of the widget's text baseline from the widget's top boundary.

返回widget文本基线的偏移,其从widget的顶部边界开始。

Integer
getCurrentHour()

This method was deprecated in API level 23. Use
getHour()


此方法在API level 23版本中被删除。使用
getHour()


Integer
getCurrentMinute()

This method was deprecated in API level 23. Use
getMinute()


此方法在API level 23版本中被删除。使用
getMinute()


int
getHour()

Returns the currently selected hour using 24-hour time.

返回当前已选择的小时(24小时模式)。

int
getMinute()

Returns the currently selected minute.

返回当前已选择的分钟。

boolean
is24HourView()
boolean
isEnabled()

Returns the enabled status for this view.

返回此视图的使能状态。

void
setCurrentHour(Integer
currentHour)

This method was deprecated in API level 23. Use
setHour(int)


此方法在API level 23版本中被删除。使用
setHour(int)


void
setCurrentMinute(Integer
currentMinute)

This method was deprecated in API level 23. Use
setMinute(int)


此方法在API level 23版本中被删除。使用
setMinute(int)


void
setEnabled(boolean enabled)

Set the enabled state of this view.

设置此视图的使能状态。

void
setHour(int hour)

Sets the currently selected hour using 24-hour time.

设置当前已选择的小时(24小时模式)。

void
setIs24HourView(Boolean
is24HourView)

Sets whether this widget displays time in 24-hour mode or 12-hour mode with an AM/PM picker.

设置此控件显示的时间模式,24小时模式或带AM/PM选取器的12小时模式。

void
setMinute(int minute)

Sets the currently selected minute.

设置当前已选择的分钟。

void
setOnTimeChangedListener(TimePicker.OnTimeChangedListener
onTimeChangedListener)

Set the callback that indicates the time has been adjusted by the user.

设置回调,以通知用户已经调整了时间。

boolean
validateInput()

Validates whether current input by the user is a valid time based on the locale.

验证当前用户输入的时间是否本地的有效时间。

保护方法

void
onRestoreInstanceState(Parcelable
state)

Hook allowing a view to re-apply a representation of its internal state that had previously been generated by
onSaveInstanceState()
.

由应用程序实现,以有机会允许视图重新应用以前由
onSaveInstanceState()
生成的内部状态。

Parcelable
onSaveInstanceState()

Hook allowing a view to generate a representation of its internal state that can later be used to create a new instance with that same state.

由应用程序实现,以有机会允许视图生成其内部状态,稍后可用于创建具有相同状态的新实例。

继承方法

完整内容,请查看:http://www.zhdoc.net/android/reference/android/widget/TimePicker.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息