1
以下三個xml文件是我的自定義滾動條。我想在scroll.xml外面設置seek_bar_thumboutsite.xml。設置自定義圓角scrollbarThrtVertical scrollbarTrackVertical android
style.xml
<style name="scroll">
<item name="android:scrollbarThumbVertical">@drawable/seek_bar_thumb</item>
<item name="android:scrollbarTrackVertical">@drawable/scroll</item>
<item name="android:scrollbarThumbHorizontal">@drawable/scrollbar_handle</item>
<item name="android:scrollbarTrackHorizontal">@drawable/scrollbar_track</item>
<item name="android:scrollbarFadeDuration">0</item>
<item name="android:scrollbarAlwaysDrawVerticalTrack">true</item>
</style>
**scroll.xml**
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#E3E3E3"/>
<stroke android:width="1dp"
android:color="#E3E3E3" /><!-- #330000FF #ffffffff -->
<gradient
android:startColor="#E3E3E3"
android:endColor="#E3E3E3"
android:angle="90"/>
<padding android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp"/>
<corners android:bottomRightRadius="7dp"
android:bottomLeftRadius="7dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp"/>
</shape>
**seek_bar_thumb**
<?xml version="1.0" encoding="UTF-8"?>
<!-- @author : @alexduhem
blog.sakaroz.com
-->
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size
android:width="25dip"
android:height="25dip" />
<stroke
android:width="1dip"
android:color="#ff5da8d4" />
<gradient
android:startColor="#ff0e75af"
android:endColor="#ff1997e1"
android:angle="270"
android:type="linear" />
</shape>
我想拇指看起來像下面的進度條隨機輪scrollthumbvertical。唯一的區別是,滾動滑塊應垂直
你到底想要什麼?你想要垂直方向的所有seekbar嗎?或者您想將代碼寫入.xml文件之外。 –
我想垂直位置的seekbar – Dimitri