My layout xml is as follows:
<SeekBar
android:id="@+id/progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="10dp"
android:gravity="center"
android:progressDrawable="@drawable/progressbar_drawable"
android:progress="50"
android:thumb="@drawable/progressbar_handle_selector"
android:layout_toLeftOf="@+id/showChat"
android:layout_toRightOf="@+id/play" />
Seekbar's progress drawable is as follows:
@drawable/progressbar_drawable
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@android:id/background" android:drawable="@drawable/bg_progressbar_9patch"/>
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:angle="90"
android:endColor="#d9b546"
android:startColor="#cc520f" />
</shape>
</clip>
</item>
</layer-list>
As a result, background bitmap (white one) doesnt stretch in height and remains too low as compared to progress drawable (orange one), here is an example:
What is more, it looks different on different screens: background bitmap has different height as compared to progress drawable. For example (another screen):
My question is: why aren't progress and background drawables (orange and white stripes) always of same height and what to do to make them of the same height?
UPDATE
Png resources:
I created 9-patch from your image and put it in drawable-hdpi folder and everything looks fine... i have some artifacts in eclipse ui previewer but everything is OK on device...
https://dl.dropbox.com/u/13106986/bg_progressbar_patch.9.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With