Android 自定义progressBar样式

Android 自定义progressBar样式

  (2012-04-19 10:40:35)
标签: 

it

 
Android <wbr>自定义progressBar样式

1、新建 myprogress_style.xml在drawable中
<?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="8.0dip" />
<gradient android:startColor="#EEEEEE" android:endColor="#EEEEEE"
android:angle="270.0" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="0.0dip" />
<gradient android:startColor="@color/red" android:endColor="@color/red"
android:centerColor="@color/red" android:angle="270.0" />
</shape>
</clip>
</item>

</layer-list>

//android:startColor="@color/red" 为自定义开始颜色
//<corners android:radius="0.0dip" /> 为两头圆角的弧度,值越大越圆
//<gradient > 为设置渐变色背景 angle 为角度,必须是45的倍数

2、引用
<ProgressBar android:id="@+id/pic_ProgressBar"
style="?android:attr/progressBarStyleHorizont al" 
android:layout_width="fill_parent" 
android:visibility="gone" 
android:layout_height="5dip"
android:progressDrawable="@drawable/myprogress_style">
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值