如何使用ProgressBar动态设置进度条渐变
来源:互联网 发布:期货 可用资金算法 编辑:程序博客网 时间:2024/06/06 12:33
下面讲下ProgressBar进度条渐变的使用,不废话,直接上代码
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:layout_marginTop="30dp" android:paddingLeft="10dp" android:paddingRight="10dp"> <ProgressBar android:id="@+id/progress_bar" style="@style/Widget.AppCompat.ProgressBar.Horizontal" android:layout_width="0dp" android:layout_height="3dp" android:layout_weight="1" android:progressDrawable="@drawable/progress_bar"/> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:gravity="center|bottom" android:orientation="horizontal"> <TextView android:id="@+id/progress_tx" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:textColor="#ff999999" android:textSize="14sp"/> <TextView android:id="@+id/percent_sign_tx" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="%" android:textColor="#ff999999" android:textSize="9sp"/> </LinearLayout></LinearLayout>重要代码(自定义XML布局):
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <corners android:radius="2dp"/> <solid android:color="#ffe9e9e9"/> </shape> </item> <item android:id="@android:id/secondaryProgress"> <clip> <shape> <corners android:radius="2dp"/> <gradient android:angle="0" android:endColor="#ea4745" android:startColor="#ffbf30" /> </shape> </clip> </item> <item android:id="@android:id/progress"> <clip> <shape> <corners android:radius="2dp"/> <gradient android:angle="0" android:endColor="#ea4745" android:startColor="#ffbf30" /> </shape> </clip> </item></layer-list>main方法:
圆形动态破浪效果的文章:Android实现波浪效果,带百分比进度
阅读全文
1 0
- 如何使用ProgressBar动态设置进度条渐变
- Android进度条ProgressBar颜色的渐变设置
- 代码动态设置ProgressBar进度条样式
- Android:动态设置颜色渐变的进度条
- ProgressBar 进度条颜色设置
- 设置progressbar进度条颜色
- 使用progressbar实现进度条。
- progressbar 进度条的使用
- 使用ProgressBar实现进度条
- 使用ProgressBar实现进度条
- 使用ProgressBar实现进度条
- 横向ProgressBar进度条的设置
- backgroundworker使用 实现进度条ProgressBar
- Android ProgressBar进度条的使用
- Android ProgressBar进度条的使用
- backgroundworker使用 实现进度条ProgressBar
- Android进度条ProgressBar使用详解
- wpf 进度条 ProgressBar的使用
- Microsoft Office 2016 Project Visio Pro Plus 64 32 下载
- C# Office 在线转PDF
- 期末复习嘎嘎嘎
- vue2.0 页面在华为自带浏览器里无法打开。
- 软件测试员如何提升自己
- 如何使用ProgressBar动态设置进度条渐变
- spring事务五种配置方式
- 【Git】Git常用命令清单
- 通过一个kaggle实例学习解决机器学习问题
- 安卓学习
- d3画树形图
- webview网页加载为加载完成引起的崩溃
- 20个android开源项目
- matlab guide未定义与 'matlab.ui.control.UIControl' 类型的输入参数相对应的函数