I have UIBUtton
in UICollectionViewCell
as show in image. I had set touchUpInside Action in xib. I had set background image of button is pink and lable as yellow. UIButton
comes at top of the label. Now the problem is that UIButton
in not getting touch event in pink area it only get touch events on orange area. why it is so.
- (IBAction)checkButtonTap:(id)sender event:(id)event
{
DLog(@"%s",__func__);
}
O a hidden view is overlapping the button due to which it is touch event was not reaching to the button.
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)]; [buttonname addGestureRecognizer:tapGesture]; buttonname.userInteractionEnabled = YES;