Android 组件----------SeekBar

SeekBar的各种配置,进度条中配置drawalbe时尽量不要用color来赋值,有时出现的效果并不是你想要的。

进度条:

<?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/com_progressbar_arrived1" />  
        
    <item android:id="@android:id/secondaryProgress"  
          android:drawable="@drawable/com_progressbar_arrived_all">  
    </item>      
       
    <item android:id="@android:id/progress"  
          android:drawable="@drawable/com_progressbar_arrived_all">  
           
    </item>    
</layer-list> 

滑块:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
	<item android:state_pressed="true" android:drawable="@drawable/com_progressbar_arrived_button_s"></item>
	<item android:state_pressed="false" android:drawable="@drawable/com_progressbar_arrived_button_uns"></item>
</selector>

控件:

		<SeekBar
		    android:id="@+id/picture_setting_item2_seekbar"
			android:layout_width="203dp"
			android:layout_height="wrap_content"
			android:thumb="@drawable/seekbar_thumb_style"
			android:progressDrawable="@drawable/seekbar_style"
			style="?android:attr/progressBarStyleHorizontal"
			android:minHeight="5dp"
			android:maxHeight="5dp"	
			android:paddingLeft="7dp"
			android:paddingRight="7dp"
			android:layout_marginTop="13dp"
			android:max="100"
			android:secondaryProgress="0"
			android:layout_gravity="center"
			/>





你可能感兴趣的:(Android 组件----------SeekBar)