【问题标题】:How to scroll a UIScrollView containing a UIView?如何滚动包含 UIView 的 UIScrollView?
【发布时间】:2011-03-03 19:17:00
【问题描述】:
UIView * blueView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 100, 100)];
blueView.backgroundColor = [UIColor blueColor];
[scrollView addSubview:blueView];
scrollView.contentSize = CGSizeMake(1500, 2000);

我可以在大多数 scrollView 中进行拖动滚动,但在 blueView 中触摸开始时拖动不起作用。

从 UIView(本例中为 blueView)开始的触摸如何滚动 UIScrollView?

blueView 不是第一响应者,blueView 的下一个响应者是 scrollView 等

看起来很基本,但我现在被困了一段时间。我错过了什么?谢谢。

【问题讨论】:

    标签: iphone ios uiscrollview


    【解决方案1】:

    尝试设置blueView.userInteractionEnabled = NO

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-27
      • 2015-11-21
      • 2013-10-27
      • 1970-01-01
      • 2012-05-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多