colock

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center_horizontal">
    <!-- 定义模拟时钟 -->
    <AnalogClock
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    <!-- 定义数字时钟 -->
    <TextClock
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20dp"
            android:textColor="#f0f"
            android:format12Hour="yyyy年MM月dd日 H:mma EEEE"
            android:drawableEnd="@mipmap/ic_launcher" android:drawableRight="@mipmap/ic_launcher"/>
    <!-- 定义模拟时钟,并使用自定义表盘、时针图片 -->
    <AnalogClock
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:dial="@drawable/watch"
            android:hand_minute="@drawable/hand"/>
</LinearLayout>
View Code

 

知识点:(划重点了)

第三个表盘和分针是一个图片

android:dial="@drawable/watch"
            android:hand_minute="@drawable/hand

 

posted @ 2019-09-06 20:07  超级学渣渣  阅读(585)  评论(0编辑  收藏  举报