如何調整seekbar的高度

 調整seekbar的高度可以這麼做:seekbar的屬性:

android:progressDrawable="@drawable/seekbar_style"
seekbar_style.xml爲:
<?xml version="1.0" encoding="UTF-8"?>     
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">     
   <item android:id="@android:id/progress">     
       <clip>  
            <shape android:shape="rectangle">  
                <corners android:radius="2dip" />  
                <gradient android:startColor="#80000000" android:width="10dp"  
                    android:centerColor="#7e209e" android:centerY="0.5" android:angle="90"  
                    android:endColor="#80000000" />  
                <stroke android:width="10dp" android:color="#80000000"  
                    android:dashWidth="1dp" android:dashGap="1dp" />  
            </shape>  
        </clip>      
   </item>     
</layer-list>


如果你說的是thrumb(也就是點擊拖動的那塊灰色的地方),可以修改屬性android:thumb="@drawable/thumb",自定應thumb.xml

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章