问题
I want to create a seekbar like in this image:
seekbar http://i47.tinypic.com/k2k54z.jpg
The question is, how to place thumb above the progress line?
This line
android:thumb="@drawable/thumb"
places the thumb in the center of the line. Any suggestions?
回答1:
you can assume the whole bar and the above thumb as one seekbar what you have to do is just include the blank area above the bar in progress and background image and include the blank area below the thumb in the image for thumb.
回答2:
I am also face same problem..and find out the following solution,
Solution - Adjust your thumb with layer-list..
Create custom_thumb.xml (in your drawable folder)
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:width="50dp"
android:height="50dp"
android:top="35dp"
android:bottom="35dp"
android:drawable="@drawable/thumb"/>
</layer-list>
Adjust width, height,top,bottom as per your need.
and set thumb using following code
android:thumb="@drawable/custom_thumb"
来源:https://stackoverflow.com/questions/12099321/android-seekbar-with-custom-thumb