效果是这样,没动图.
布局:
<LinearLayout android:layout_width="wrap_content" android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:layout_centerInParent="true" android:layout_height="wrap_content"> <com.example.herman.testui.CountDownView android:id="@+id/tv_red_skip" android:layout_width="130dp" android:text="跳过" android:textColor="#ffffff" android:textSize="10sp" android:layout_height="130dp" /> </LinearLayout>
values下新建一个attr.xml,内容是:
<?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="CountDownView"> <!--颜色--> <attr name="ringColor" format="color" /> <!-- 进度文本的字体大小 --> <attr name="progressTextSize" format="dimension" /> <!-- 圆环宽度 --> <attr name="ringWidth" format="float" /> <!--进度文本颜色--> &l