继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Android倒计时 Android仿京东倒计时 android电商app源码倒计时源码

一只斗牛犬
关注TA
已关注
手记 338
粉丝 49
获赞 300

countdown

一个简单的计时器

图片描述

提供了一些方法

设置margin
public void setLinearLayoutMargin(int left, int top, int right, int bottom)
public void setTextViewMargin(int left, int top, int right, int bottom)
设置Padding
public void setLinearLayoutPadding(int left, int top, int right, int bottom)
public void setTextViewPadding(int left, int top, int right, int bottom)
设置背景
public void setLinearLayoutDrawable(Drawable d)
public void setTextViewDrawable(Drawable d)
设置背景色
public void setLinearLayoutBgColor(int color)
public void setTextViewBgColor(int color)

xml中的一些方法

countdown:color_bg //设置背景色
countdown:color_text //设置字体颜色
countdown:text_size //设置字体大小
countdown:setDrawable //设置父容器背景
countdown:setDrawable_sub //设置子控件背景

怎么使用

xml中

<com.zy.lib.countdown.CountDownView

    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

Java中

setStopTime();//设置一个long类型的停止时间

源码详细地址:https://github.com/zyAndroid/countdown

原文链接:http://www.apkbus.com/blog-920677-76987.html

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP