I do not know if there is code for this. I achieve this by creating xml with maximum height and other attributes and inflating seekBar in my definition:
In XML:
<?xml version="1.0" encoding="utf-8"?> <SeekBar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:progressDrawable="@drawable/custom_player_seekbar_background" android:paddingTop="10px" android:paddingBottom="10px" android:thumb="@drawable/bt_do_player" android:paddingLeft="30px" android:paddingRight="30px" android:minHeight="6dip" android:maxHeight="6dip" android:layout_height="wrap_content" android:layout_centerVertical="true"/>
And in java code:
volumeSeekBarPL = (SeekBar) getLayoutInflater().inflate(R.layout.custom_seek_bar, null);
source share