Android平板时间插件,Android 实时显示时间控件
原生代碼已經提供了顯示實時時間的控件,因此只需要添加進去即可,不需要另外構造定時器去不斷的刷新。
如圖:
代碼如下:
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:layout_gravity="center"
android:format24Hour ="HH:mm"
android:format12Hour ="hh:mm"
android:textColor="@color/txt_00C483"
android:textSize="70dp" />
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_time"
android:layout_centerHorizontal="true"
android:format24Hour ="MM月dd日 EEEE"
android:format12Hour ="MM月dd日 EEEE"
android:textColor="@color/txt_00C483"
android:textSize="20dp" />
就是這么簡單 什么類也不用寫...
總結
以上是生活随笔為你收集整理的Android平板时间插件,Android 实时显示时间控件的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: JavaScript打印页面的出错异常与
 - 下一篇: 用FireFox+FVD看TS格式流媒体