猫在练习长跑,乌龟讽刺道:再练,也不能跑出个长跑冠军!猫答:我成不了豹子,却能做最棒的猫!是的,努力做好自己,做到最棒,就是成功!加油!
本讲内容:DatePicker 日期选择器控件 TimePicker 时间选择器控件
示例一:以界面显示日期时间选择器控件
下面是res/layout/activity_main.xml 布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/id_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20sp"/>
<DatePicker
android:id="@+id/id_datePicker"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>