ProgressBar 颜色的设置
来源:互联网 发布:兰蔻网络推广方案 编辑:程序博客网 时间:2024/04/30 12:40
转载自:http://blog.csdn.net/mars2639/article/details/6620836
布局文件代码:
- <ProgressBar
- android:id="@+id/progressbar"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:indeterminateDrawable="@drawable/progressbar"
- />
此XML文件新建在drawable目录下:文件名为:progressbar
- <?xml version="1.0" encoding="utf-8"?>
- <animated-rotate
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:pivotX="50%" android:pivotY="50%"
- android:fromDegrees="0"
- android:toDegrees="360">
- <shape
- android:shape="ring"
- android:innerRadiusRatio="3"
- android:thicknessRatio="8"
- android:useLevel="false">
- <gradient
- android:type="sweep"
- android:useLevel="false"
- android:startColor="#6BD3FF"
- android:centerColor="#FF7121"
- android:centerY="0.50"
- android:endColor="#FFFF00" />
- </shape>
- </animated-rotate>
至于设置水平进度条的颜色:
- <LinearLayout android:gravity="center"
- android:orientation="horizontal"
- android:padding="10dp"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
- <SeekBar android:layout_gravity="center" android:id="@android:id/progress"
- android:paddingLeft="8.0dip" android:paddingRight="8.0dip"
- android:paddingBottom="4.0dip" android:layout_width="fill_parent"
- android:layout_height="wrap_content" android:maxHeight="2.0px"
- android:progressDrawable="@drawable/progressbar_drawable" android:minHeight="2.0px"
- android:thumb="@drawable/seekbar_thumb" style="?android:attr/progressBarStyleHorizontal" />
- </LinearLayout>
progressbar_drawable.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="2.0dip" />
- <gradient android:startColor="#ff000000" android:centerColor="#ff000000" android:endColor="#ff000000" android:angle="270.0" android:centerY="2.0" />
- </shape>
- </item>
- <item android:id="@android:id/progress">
- <clip>
- <shape>
- <corners android:radius="2.0dip" />
- <gradient android:startColor="#ff33b5e5" android:centerColor="#ff33b5e5" android:endColor="#ff33b5e5" android:angle="270.0" android:centerY="2.0" />
- </shape>
- </clip>
- </item>
- </layer-list>
0 0
- ProgressBar 颜色的设置
- ProgressBar 颜色的设置
- ProgressBar 颜色的设置
- ProgressBar 颜色的设置
- ProgressBar 颜色的设置
- ProgressBar 颜色的设置
- Android 设置ProgressBar 的颜色
- Android:ProgressBar 颜色的设置
- 设置progressbar的背景颜色
- Android UI 设置ProgressBar的颜色
- android 设置progressbar的背景颜色
- ProgressBar 圆形进度条颜色的设置
- android 设置progressbar的背景颜色
- ProgressBar水平进度条的颜色设置
- android ProgressBar水平进度条的颜色设置
- ProgressBar水平进度条的颜色设置
- android开发--ProgressBar 颜色/样式的设置
- Android进度条ProgressBar颜色的渐变设置
- ArcEngine修改像素值与像元值
- Ubuntu上配置Swift的开发环境,基于JetBrains的Clion编辑器
- Objective-C单例设计模式
- AVI Player with Playmaker actions 播放插件浅谈 (一)
- 使用百度地图查询经过某一公交站的所有公交线路
- ProgressBar 颜色的设置
- iOS中关于UIButton缩进问题
- Oracle中由 case when 报错 ORA-12704:字符集不匹配的简易解决
- poi导出excel直接打包的方法
- 基于Activiti5工作流实战企业协同OA办公系统(spring-data-jpa、uur前台组件)
- oj--C++结构体之统计最高最低分
- Android中TextView中设置字体颜色
- 商品秒杀
- 设置 label 的行间距和删除线