问题
i have a query to ask.
How can i move a seekbar on a button click incrementing by 0.25
i.e i have created two buttons + for increase and - for decrease.Is it possible??
I have set "max" of seekbar 60 and onProgress change I am multiplying the progress value by 0.25 to increment my precision by 0.25. But my seekbar is not moving on each button click i.e for value 0 to 1 it doesn't move from 0.25 to 0.75, after clicking from 0.75 it moves to 1. I am not getting it to move on each value.
回答1:
AFAIK,you cannot use float value as progress of spinner. It must be an Integer value.so better you set maximum progress as an integer value that is total of how many clicks you want user to reach to right most side of spinner.
Ex. you want user to give 10 clicks for going from left to right in spinner,just set maximum progress as 10.
So if you want behavior like you asked for,then..
For Examlple: you want user to see 1 to 5 progress incremented by 0.25 each time he clicks on spinner,then set your progess as 5*4=20 and then show increment as it is added by 0.25 in each click.but actually you will have to increment progress by 1 only.

来源:https://stackoverflow.com/questions/9000289/movement-of-seekbar-on-button-click