Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Remove SeekBar Background

Is there a way I can remove the background bar image in the SeekBar android widget?

I just want it to show a slider with no progress bar behind it.

Remove this

Any help?

like image 614
Kleptine Avatar asked Mar 17 '10 01:03

Kleptine


2 Answers

There is a simpler way that doesn't require creating a new drawable. Simply set the following in your xml definition

android:progressDrawable="@android:color/transparent"

Or if you want to do it in your code:

mySlider.setProgressDrawable(new ColorDrawable(android.R.color.transparent));
like image 169
Pooks Avatar answered Oct 01 '22 11:10

Pooks


Well I solved my own problem.

To remove the background, you have to create a blank drawable and set it to the progressDrawable:

satBar.setProgressDrawable(invisibleBackground);

Setting it to null doesn't seem to work.

like image 30
Kleptine Avatar answered Oct 01 '22 10:10

Kleptine