我有一個uicollectionviewcontroller,我用它在屏幕底部創建一個小工具欄。我將uicollectionviewcontroller的視圖添加到另一個視圖控制器的視圖。我的問題是它不會將觸摸事件轉發到它下面的視圖。我確實將它移動到了底部,並且工作了一段時間,但現在我需要使用2個自選視圖。如何將觸摸事件轉發到uicollectionview背後的視圖?
我該如何將觸摸事件轉發到uicollectionviewcontroller視圖下的視圖?
我有一個uicollectionviewcontroller,我用它在屏幕底部創建一個小工具欄。我將uicollectionviewcontroller的視圖添加到另一個視圖控制器的視圖。我的問題是它不會將觸摸事件轉發到它下面的視圖。我確實將它移動到了底部,並且工作了一段時間,但現在我需要使用2個自選視圖。如何將觸摸事件轉發到uicollectionview背後的視圖?
我該如何將觸摸事件轉發到uicollectionviewcontroller視圖下的視圖?
如果問題仍然相關,可以使用以下內容來實現觸摸轉發。
覆蓋 - (無效)touchesEnded:(NSSet中*)觸摸withEvent:方法(的UIEvent *)事件;
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
[super touchesEnded:touches withEvent:event];
[self.yourCustomDelegate forwardTouches:touches withEvent:(UIEvent *)event];
}
也就是說UICollectionView如何能保持其對用戶交互的響應能力,並同時轉發收到的觸摸。
,因爲我覺得你可以添加你的工具欄作爲UICollectionView的頁腳,它會工作