Harish
Harish

Reputation: 2512

exclusive touch function

In my app i have an UISlider which is subview of UIScrollView, where everything is done programatically. Here i have set,

 scrollview.userInteractionEnabled=NO;

When i set this UISlider also disabled, i.e i can't able to access UISlider, here i need to set userInteractionEnabled to NO only for my scrollview, for this issue i have used,

scrollview.exclusivetouch=NO;

but still i can't able to access UISlider. Please help me

Upvotes: 0

Views: 738

Answers (2)

Andy Smart
Andy Smart

Reputation: 725

Try this:

scrollView.userInteractionEnabled = YES;
scrollView.scrollEnabled = NO;

That way, touches are handled, but scrolling is disabled (unless you set the contentOffset programatically).

Upvotes: 0

Nirav Jain
Nirav Jain

Reputation: 5107

if touch event is detected by UISlider, tell your UIScrollview to pass an event to UISlider.

Make sure you have implemented this properties.

scrollView.userInteractionEnabled = YES;

scrollView.scrollEnabled = NO;

And one more thing, don't depend on result of simulator.

check in real device.

Upvotes: 1

Related Questions