开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜