android 自定义进度跳,Android自定义view实现进度条指示效果

先看看效果图:

15059063341.jpg?201702215198

首先是布局文件

android:layout_width="match_parent"

android:layout_marginLeft="10dp"

android:layout_marginRight="10dp"

android:layout_height="wrap_content">

android:id="@+id/pb_process"

style="@style/ProgressStyle"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:indeterminate="false" />

android:id="@+id/tv_progress"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center"

android:textColor="@color/white"/>

添加style-ProgressStyle

@drawable/my_progress

添加drawable-my_progress

android:angle="270"

android:centerY="0.75"

android:endColor="@color/gray_BB"

android:startColor="@color/gray_BB" />

android:angle="270"

android:centerColor="#f69200"

android:centerY="0.75"

android:endColor="#ff9800"

android:startColor="#ff9800" />

android:maxLevel="10000"

android:minLevel="10000">

android:angle="270"

android:centerColor="#21a837"

android:centerY="0.75"

android:endColor="#22ac38"

android:startColor="#22ac38" />

android:minLevel="0"

android:maxLevel="9999"

>

android:angle="270"

android:centerColor="#f69200"

android:centerY="0.75"

android:endColor="#ff9800"

android:startColor="#ff9800" />

activity里的使用和安卓默认的一样

pb_progress.setMax();

pb_progress.setProgress();

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程小技巧。

总结

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。

小编个人微信号 jb51ccc

喜欢与人分享编程技术与工作经验,欢迎加入编程之家官方交流群!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值