简体   繁体   中英

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, ie 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

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.

Try this:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM