首页 > 其他 > 详细

progerssbar-style 属性分析

时间:2015-04-23 12:35:10      阅读:451      评论:0      收藏:0      [点我收藏+]

先看如下代码

 <ProgressBar
                android:id="@+id/progress_bar"
                style="@style/Voiceunlock.Theme.ProgressBar.Horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginEnd="30dip"
                android:layout_marginStart="30dip"
                android:max="100"
                />

style的代码如下

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@android:id/background"
            android:drawable="@drawable/scrubber_bg_funui" />
    <item android:id="@android:id/secondaryProgress">
        <scale android:scaleWidth="100%"
               android:drawable="@drawable/scrubber_secondary_funui" />
    </item>
    <item android:id="@android:id/progress">
        <scale android:scaleWidth="100%"
               android:drawable="@drawable/scrubber_primary_funui" />
    </item>
</layer-list>

里面用到的颜色值如下

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <drawable name="scrubber_bg_funui">#000000</drawable>
    <drawable name="scrubber_secondary_funui">#ff0000</drawable>
    <drawable name="scrubber_primary_funui">#00ff00</drawable>
</resources>

运行结果如下

 

progerssbar-style 属性分析

原文:http://www.cnblogs.com/zhangshuli-1989/p/4449829.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!