How to scroll a UIScrollView containing a UIView?
UIView * blueView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 100, 100)];
blueView.backgroundC开发者_高级运维olor = [UIColor blueColor];
[scrollView addSubview:blueView];
scrollView.contentSize = CGSizeMake(1500, 2000);
I can drag-scroll in most of scrollView just fine, but dragging when the touch starts in blueView doesn't work.
How can touches that start within the UIView (blueView in this case) scroll the UIScrollView?
blueView is not first responder, blueView's next responder is scrollView, etc.
Seems pretty basic, but I'm stuck for a while now. What am I missing? thx.
Try setting blueView.userInteractionEnabled = NO
.
精彩评论