How to define a SeekBar's minimum value? Is this done in the XML layout or do I need to define it programatically?
Basically I need to change my minimum value from 0 to 0.2
setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub //int inVal = Integer. parseInt(String. valueOf(seekBar. getProgress())); //inVal =+ 70; //Toast.
Programmatically using Java code:seekBar = (SeekBar) findViewById(R. id. seekBar1); seekBar. setMax(225);
android.widget.SeekBar. A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. Placing focusable widgets to the left or right of a SeekBar is discouraged.
You can use the Slider provided by the Material Components Library. Use the app:trackHeight="xxdp" (the default value is 4dp ) to change the height of the track bar. It requires the version 1.2. 0 of the library.
How to define a SeekBar's minimum value?
You can't define the minimum value. It is 0
.
Basically I need to change my minimum value from 0 to 0.2
When you get the value, add 0.2
to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With