You could try setting the delaysContentTouches
to false
on your UIScrollView.
In my case, when button is into a subview -> into a ScrollView, the tap will not be cached, non matter what scroll view settings you have..
So I added the button as subview of my scrollView and tap was fired
scrollView.addSubview(button)
CGRect frameforMainView = mainView.frame;
frameforMainView.size.height = viewFirstAnswerButton.frame.origin.y + viewFirstAnswerButton.frame.size.height;
mainView.frame = frameforMainView;
//Now Set ContentSize Of scroll view;
[scrollView setContentSize:CGSizeMake(0, mainView.frame.origin.y + mainView.frame.size.height)];
if you are using Autolayouts then don't forget to add translatesAutoresizingMaskIntoConstraints = YES
Drag all subviews from mainView to ScrollView. And hide the mainView. Make sure mainView(ContainerView of scrollView) should also be a subView of scrollView.
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.