自定义钟表,分为几个步骤
- 绘制原盘
- 绘制刻度(大刻度、小刻度…)
- 绘制指针(时针、分针、秒针)
- 让指针根据当前时间动起来
|
|
在xml中引用123456789101112<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <com.utstartcom.custom.view.view.ClockView android:padding="5dp" android:layout_width="300dp" android:layout_height="300dp" /></LinearLayout>