ProgressBar样式设置

 在进度条的设置中,setIndeterminate()方法是用来设置进度条是否采用‘模糊模式’(这是我杜撰的名称,但意思没                       错,Indeterminate的意思就是‘不确定的,模糊的,不明确的’

当设置setIndeterminate(true)参数为时,进度条采用不明确显示进度的‘模糊模式’,

当设置setIndeterminate(false)参数为假, 进度条不采用‘模糊模式’,而采用明确显示进度的‘明确模式’,







滑块设置 

android:thumb="@drawable/ic_flat_fragment_seek_thumb"
thumb 滑块和进度条无法粘在一起的,图片空位太多


进度条设置
android:progressDrawable="@drawable/line_flat_fragment_seekbar_bg"

<?xml version="1.0" encoding="UTF-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 背景色,第二进度条, 第一进度条 -->
    <item
        android:id="@android:id/background"
        android:drawable="@drawable/bg_main_splash"/>
<!--    <item
        android:id="@android:id/secondaryProgress"
        android:drawable="@drawable/secondary"/>-->
    <item
        android:id="@android:id/progress"
        android:drawable="@drawable/icon_web"/>
</layer-list>

其中的drawable可以使用图片 也可以使用安卓的
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    
 
    <solid
        android:color="@android:color/white"/><!-- 填充的颜色 -->
    
  
</shape>


android:layout_width="match_parent"  //进度条如果设成wrap_content 且不设max 会无法拖动
android:maxHeight="1dp"    //进度条的最大高度, 不设的话进度条会和滑块图片一样大 minheight同理.
android:layout_height="match_parent"  //滑块的高度

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值