I have many SubViews in my UIView
, and many of them have UIButtons
in them. One of the subviews- _bottomView
(Coordinates- (0,519,320,49)) has an error. It does not recognise the click events on the buttons placed inside it.
I tried placing a UIButton
covering the entire _bottomView
and the click event from that Button (testButton
) is not being recognised either.
I tried adding a tapRecogniser to the code and the tap from every point, EXCEPT the points within the _bottomView are recognised. TapRecogniser Code below
UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
[self.view addGestureRecognizer:gr];
_bottomView.userInteractionEnabled=true;
-(void)handleGesture:(UIGestureRecognizer *)gestureRecognizer {
CGPoint p = [gestureRecognizer locationInView:self.view];
NSLog(@"got a tap in the region i care about");
}
I tried [self.view addSubview:_bottomView];
and that didn't help either. What could be the issue?