2013-05-01 67 views
1

我有一个uicollectionviewcontroller,我用它在屏幕底部创建一个小工具栏。我将uicollectionviewcontroller的视图添加到另一个视图控制器的视图。我的问题是它不会将触摸事件转发到它下面的视图。我确实将它移动到了底部,并且工作了一段时间,但现在我需要使用2个自选视图。如何将触摸事件转发到uicollectionview背后的视图?

我该如何将触摸事件转发到uicollectionviewcontroller视图下的视图?

回答

2

如果问题仍然相关,可以使用以下内容来实现触摸转发。

  1. 子类UICollectionView
  2. 覆盖 - (无效)touchesEnded:(NSSet中*)触摸withEvent:方法(的UIEvent *)事件;

    -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ 
        [super touchesEnded:touches withEvent:event]; 
        [self.yourCustomDelegate forwardTouches:touches withEvent:(UIEvent *)event]; 
    } 
    

    也就是说UICollectionView如何能保持其对用户交互的响应能力,并同时转发收到的触摸。

相关问题