I have a subview which is allmost half to my mainview and also I have a UISlider on my mainview . My silder has a value from 0 to 10. i want to add some UIButtons to my Subview with the UISilder.Now if my silder get the value 2 then i want to add 2 UIButtons to my Subview as if my silder pass the value 2 and gets the value 4 then I want to remove the previous UIButtons from Subview and Add some new UIButtons to Subview .
I have a subview which is allmost half to my mainview and also I
Share
Note: The code is untested.
Initiate a 10
UIButtonand add them to the view, set them as hidden:Use the slider change value method to hide/show the buttons like this:
Update
To use a
UIScrollView, you have to add theUIButtons to the scrollView instead of the view, like this:then add the scrollView to the view:
hope this can help you.