Reputation: 665
I am creating a custom style for a seek bar using xml:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<solid android:color="#00FF00" />
<corners android:radius="0dp" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="#FF0000" />
<corners android:radius="0dp" />
</shape>
</clip>
</item>
</layer-list>
<style name="Widget.MySeekBar" parent="android:Widget.SeekBar">
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@drawable/seek_bar_progress</item>
<item name="android:minHeight">3dp</item>
<item name="android:maxHeight">3dp</item>
<item name="android:thumb">@drawable/image_seek_bar_thumb</item>
<item name="android:thumbOffset">8dp</item>
<item name="android:focusable">true</item>
</style>
I want the background to be thinner than the progress similar to the standard jelly bean style seek bars. Is there any way to do this?
Thanks
Upvotes: 1
Views: 934
Reputation:
I have used this in xml:
<SeekBar
android:id="@+id/seekID"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayoutComponentTopRow"
android:layout_marginTop="1px"
android:background="@drawable/slide_bar"
android:progress="0"
android:secondaryProgress="0"
android:thumb="@drawable/bt_slider" />
It sets the background and the thumbnail too. I hope it helps!
Upvotes: 1