在进度条的设置中,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" //滑块的高度