【问题标题】:Passing touches to a UIView将触摸传递给 UIView
【发布时间】:2013-06-05 10:51:15
【问题描述】:

我有一个视图有 2 个子视图,我们称它为父视图。这2个子视图(假设它们是A和B),重叠,A覆盖了B的一部分。B视图上有一些按钮,其中一个被A覆盖。由于A背景颜色是清晰的颜色,用户可以看到那个按钮,并且可能想按下它,但可惜他不能。

在正常模式下,如果 A 是 B 的子视图,我可以这样做:

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

   // pass touches to next responder in chain
   [self.nextResponder touchesBegan:touches withEvent:event];
}

但既然不是这样,我怎么能把这种接触传递给 B?

【问题讨论】:

    标签: ios uiview uiresponder


    【解决方案1】:

    试试这个

    [[self view] bringSubviewToFront:subview_B];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-21
      • 1970-01-01
      • 2014-01-12
      • 1970-01-01
      • 2013-11-09
      • 1970-01-01
      • 2011-09-16
      相关资源
      最近更新 更多