I’m trying to include a horizontal progress bar in my application. The idea is that when a user clicks a button the bar decrements by 1/10th of its length. Then when its ’empty’ clicking a second button would set it back to 10/10.
Any ideas on how to do this? I’ve performed a search but most tutorials appear to deal with loading files etc and not adjusting the bar by a button click.
Thanks so much.
Just set up an
onClick(...)method and decrease the progress of the bar each time it’s clicked. UsegetMax()to determine the maximum value, then divide it by 10 to get the step downward. Just make sure it doesn’t go below 0.Then, in your second button, to reset to maximum: