3

I need seekbar like this :

seekbar

I don't know how to set step values for seekbar if anybody has customized seekbar like kindly help me

Basi
  • 3,009
  • 23
  • 28
kishore kumar
  • 63
  • 3
  • 8

2 Answers2

3

I will suggest three ways. First to use comboSeekBar which does what you need.

See this and this . Library link

And secondly you can simply change step in Seekbar using incrementProgressBy as this Example doing. Or you can setMax to 7 . And for each step multiply the progress with 10 as this Example does.

SeekBar seekBar = (SeekBar)layout.findViewById(R.id.seekbar);
seekBar.setProgress(0);
seekBar.incrementProgressBy(10);
seekBar.setMax(200);
Community
  • 1
  • 1
Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300
0

You can use,

seekBar.setProgress(0);  // change this to starting point... 
seekBar.incrementProgressBy(10);
seekBar.setMax(200); // change this to whereever you what to stop..

To display a textview below the seekbar,

Since you know the incrementby and max value, you can run a for loop.. and get seek.getProgress() first time, convert it to string and then keep appending incrementby to String....

thestar
  • 4,959
  • 2
  • 28
  • 22
  • i need to set stepvalues below seekbar, like in my shared image (10 20 30 40 ) – kishore kumar Jan 18 '14 at 05:46
  • yes, incrementProgressBy(10); will do that.. so change the setmax(200) to your end point.. – thestar Jan 18 '14 at 05:47
  • sorry @Sunny it doesnt show stepvalues in my output it shows like this [click here](https://www.dropbox.com/s/zrkkzc4qky940j0/Untitled.png) but i need [clickhere](https://www.dropbox.com/s/e2viidnb6pbni99/Untitled1.png) – kishore kumar Jan 18 '14 at 05:57