我有一个UICollectionViewCell,其中包含我的一些内容,如图片,标签,视图。
我想获得这种行为(就像正常细胞的相反行为):
如果我尝试安装UITapRecognizer:
// Create gesture recognizer
UITapGestureRecognizer *oneTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onShadowLayerPressed)];
// Set required taps and number of touches
[oneTap setNumberOfTapsRequired:1];
[oneTap setNumberOfTouchesRequired:1];
// Add the gesture to the view
[self.shadowView addGestureRecognizer:oneTap];
并在方法之后
- (void)onShadowLayerPressed
{
[super setSelected:YES];
[self setSelected:YES];
}
从self.shadowView收到tap,但它不会发送到单元格....
我该如何解决这个问题?
由于
答案 0 :(得分:1)