I have a UISlider
as part of a view that is loaded into a UIScrollView
with paging enabled. I've noticed an unexpected behavior. If the user tries to use the slider quickly (i.e. press and move) it "activates" the scroll view, causing the page to switch. However, if your press and hold for a second the slider "activates" and you can then adjust the slider value. This behavior is undesirable.
What is the best way to make the UISlider
responsive when loaded into a UIScrollView
? I've thought about adding a "blocker" view that just eats up touch events that is placed under the slider, but not sure if this is the best way to go about it.
Have your scroll view detect touches over the region occupied by your slider (override hitTest:withEvent:
, you may need to subclass UIScrollView
). If a touch over said region is detected, tell your scroll view to immediately pass the touch to the slider.