55

API Level < 21

Thumb is transparent, as expected.

Screenshot taken on a Nexus 5 running Android 4.4.4

On API Level 21

Thumb is opaque, Wonder why.

Screenshot taken on a Nexus 5 running Android 5.0

Here is the code

 <SeekBar
                android:id="@+id/ui_audioplayer_progressbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:progressDrawable="@drawable/custom_progress_bar_horizontal"
                android:thumb="@drawable/stud_slider" />

Interestingly, this problem can be seen and reproduced in the xml preview in eclipse itself, when you change the API Level perspectives.

When API level 21 is selected

When API level 19 is selected

Note:

  • I run the same apk on both devices.
  • Both devices are of the same make and model, i.e Nexus 5.
  • The thumb image is a PNG with a transparent background, as apparent from the screenshot for API Level < 21

Is this a known bug in Lollipop or am i doing something wrong?

Vinay W
  • 9,912
  • 8
  • 41
  • 47
  • 5
    possible duplicate of [Custom seekbar with style errors on API 21](http://stackoverflow.com/questions/26989400/custom-seekbar-with-style-errors-on-api-21) – alanv Dec 11 '14 at 21:52
  • 1
    @alanv that is the same question. Thanks for pointing out. But the question title is not descriptive enough imo. Not editing that question, and keeping this here so people could reach the answer searching with either queries. – Vinay W Dec 18 '14 at 09:27

2 Answers2

155
<SeekBar
    ....
    android:splitTrack="false" 
/>
Fedor
  • 43,261
  • 10
  • 79
  • 89
12

For all API levels,

<Seekbar
    .....
    android:background="@null"
    android:splitTrack="false"
    ....
 />

will work. It worked for me.

Yogesh Gupta
  • 319
  • 3
  • 4
  • Saved my day +1, also worked on android drawable which was implemented on imageview , so set imageview background as @null – sanjeeb Nov 14 '19 at 13:42