I need to customize a seekbar. To achieve this I’m using a layer-list XML file, and then set it as background to seekbar.
For the @android:id/background I’m using a bitmap, for secondaryProgress and progress, I’m using a shape.
This is the XML background file:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@android:id/background">
<bitmap
android:src="@drawable/progressbar_bg"
android:tileMode="repeat" />
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<solid android:color="#B2B2B2" />
<corners android:radius="5dp" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="#E00072" />
<corners android:radius="5dp" />
</shape>
</clip>
</item>
</layer-list>
And here’s how I declare the SeekBar:
<SeekBar
android:id="@+id/seekBar1"
android:thumb="@drawable/progressbar_thumb"
android:progressDrawable="@drawable/custom_seek_bar"
android:background="@drawable/progressbar_bg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_toLeftOf="@id/video_total_time"
android:layout_toRightOf="@id/video_time_played" />
The problem is that the SeekBar height does not shrink to new height, which I’m expecting to be equal with height of the background image. Instead, I see a area filled with white space.

Do you know where does the white space come from, and how to git rid of it?
The issue was solved by using a 9-patch instead of a Bitmap, for the
@android:id/backgrounditem.