问题
I made an application on paint. I want to control the size of brush being used in paint using seek-bar.
In the menu(options) ,I have an option of changing brush size. So, by clicking on it, a seek bar should appear and I should be able to control that using save button (to set) and then use that value inside paint.
How do I do that?
回答1:
Make seekbar visible inside xml or when you get its reference in onCreate method.
on button click make it visible.
Use latest values by registering OnSeekBarChangeListener on your Seekbar.
来源:https://stackoverflow.com/questions/17506026/how-to-get-a-seekbar-after-clicking-button