It is ok to set the max & min value for a UISlider control in iPhone. Accordingly slider will work – OK – Good.
First, I will give an example of what exactly I want to implement.
- In iPad comes with Calendar application as a default.
- Open calendar, at the bottom – you can see day/week/month listing
- When you slide your finger on it, you will see a pop up menu when sliding.
- I want to implement the same functionality on slider.
I am trying hard, But if I am able to get x co-ordinate, I can easily implement it. Any other suggestion for implementing same are most most welcome.
Start out with a UILabel for testing (just write something in it) and add IBOulets to it, as well as the UISlider. Next, add a IBAction for “value changed” for the slider.
You then need to calculate two values to figure out where your label should be placed — adjustment from left, and pixels per value for the slider. Your
@interfacemight look like this:In e.g. viewDidLoad: for your view controller, you do the calculation for the two floats.
And finally, your IBAction might look like this:
Hope that helps.