android 的seekbar ,我給thumb一個圖片,但是卻多了些背景出來,不透明了


android 的seekbar 的自定義樣式網上有很多例子了, 我是這么寫的 

<SeekBar
        android:id="@+id/sbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:splitTrack="false"
        android:progress="20"
        android:progressDrawable="@drawable/seekbarbg"
        android:thumb="@drawable/seekbarthumb"
        android:layout_marginLeft="10dp"/>
android:thumb 是兩張圖片組合成的一個drawable , 按上去的時候會有變化,這里就不展示了。 但是卻出現了一個問題,

thumb的圖片背景其實是透明的, 但是這里卻多了背景出來,而且這里的背景的顏色其實是整個后面的大背景的顏色。  
找了好久不知道問題在哪里, 后來在stackflow 里找到答案, 加上一句
 android:splitTrack="false"    就可以了。  暈倒


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM