安卓时间显示TextClock显示日期时间,24小时制和12小时制(自定义
安卓时间显示TextClock显示日期时间,24小时制和12小时制(自定义时间)
这个地方的是按24小时制还是12小时制 是由手机系统设置决定的,星期日如果显示为英文也是系统语言设置决定的
android:layout_width="wrap_content"
android:layout_marginRight="10dp"
android:format12Hour="yyyy-MM-dd hh:mm:ss, EEEE a"
android:format24Hour ="yyyy-MM-dd\nHH:mm:ss EEEE"
android:layout_height="wrap_content">
"MM/dd/yy h:mmaa" -> "03/07/70 6:23am"
"MMM dd, yyyy h:mmaa" -> "Apr 5, 2020 7:21am"
"MMMM dd, yyyy h:mmaa" -> "April 6, 2020 7:21am"
"E, MMMM dd, yyyy h:mmaa" -> "Mon, April 7, 2020 7:21am&
"EEEE, MMMM dd, yyyy h:mmaa" -> "Monday, April 6, 2020 6:23am"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
时间选择控件
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:timePickerMode="spinner"
android:layout_gravity="center"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:timePickerMode="clock"
>
安卓时间显示TextClock显示日期时间,24小时制和12小时制(自定义相关教程