模拟时钟(AnalogClock)和数字时钟(DigitalClock)

Demo2clock_demosrcmain eslayoutactivity_main.xml

 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 2     xmlns:tools="http://schemas.android.com/tools"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     tools:context=".MainActivity"
 6     android:orientation="vertical"
 7     android:gravity="center_horizontal">
 8 
 9     <!--自定义模拟时钟-->
10     <AnalogClock
11         android:layout_width="wrap_content"
12         android:layout_height="wrap_content" />
13     <!--自定义数字时钟-->
14     <DigitalClock
15         android:layout_width="wrap_content"
16         android:layout_height="wrap_content"
17         android:textSize="30sp"/>
18 
19 </LinearLayout>
原文地址:https://www.cnblogs.com/LY1124/p/4671541.html