public class

DatePicker

extends FrameLayout
java.lang.Object
android.view.View
android.view.ViewGroup
android.widget.FrameLayout
android.widget.DatePicker

Class Overview

This class is a widget for selecting a date. The date can be selected by a year, month, and day spinners or aCalendarView. The set of spinners and the calendar view are automatically synchronized. The client can customize whether only the spinners, or only the calendar view, or both to be displayed. Also the minimal and maximal date from which dates to be selected can be customized.

See theDate Picker tutorial.

To provide a widget for selecting a date, use theDatePickerwidget, which allows the user to select the month, day, and year, in a familiar interface.

In this tutorial, you'll create aDatePickerDialog, which presents the date picker in a floating dialog box at the press of a button. When the date is set by the user, aTextViewwill update with the new date.


public class

TimePicker

extends FrameLayout
java.lang.Object
android.view.View
android.view.ViewGroup
android.widget.FrameLayout
android.widget.TimePicker

Class Overview

A view for selecting the time of day, in either 24 hour or AM/PM mode. The hour, each minute digit, and AM/PM (if applicable) can be conrolled by vertical spinners. The hour can be entered by keyboard input. Entering in two digit hours can be accomplished by hitting two digits within a timeout of about a second (e.g. '1' then '2' to select 12). The minutes can be entered by entering single digits. Under AM/PM mode, the user can hit 'a', 'A", 'p' or 'P' to pick. For a dialog using this view, seeTimePickerDialog.

See theTime Picker tutorial.



下面是一个转载自书上的示例:



 

   

 



更多相关文章

  1. android TextView 丰富多彩的字体样式代码
  2. numberPicker实现时间选择设置功能
  3. Android设置输入框和软键盘动态悬浮
  4. Android与HTML5交互模版
  5. 安卓加载网页
  6. popuwindow
  7. android 在WebView打开网页
  8. Android(安卓)Tint ImageView 无法设置Tintlist问题
  9. Android(安卓)RatingBar

随机推荐

  1. Android画板
  2. Android(安卓)开发艺术探索笔记之十 -- A
  3. Android从零开始-Android工程的目录结构
  4. 错误ava.lang.RuntimeException: Unable
  5. 升级Android内置apk版本
  6. Android开发环境配置简介
  7. 用于替代 Android(安卓)自带 Dialog 和 P
  8. Android(安卓)最全面试题汇总(问题+答案+
  9. 深入理解Android(安卓)WebView
  10. adb devices找不到设备