android:id="@+id/tv_time"android:layout_width="wrap_content"android:l..._平板时间显示插件">
当前位置:   article > 正文

Android平板时间插件,Android 实时显示时间控件

平板时间显示插件

原生代码已经提供了显示实时时间的控件,因此只需要添加进去即可,不需要另外构造定时器去不断的刷新。

如图:

40fb10cf57aa

代码如下:

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" />

就是这么简单 什么类也不用写...

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/920729
推荐阅读
相关标签
  

闽ICP备14008679号