I have a button on the left side of the navigation bar. I also have a UIButton near that button.
Now when I click the button thats below the navigation bar, in many cases, the button on the nab bar gets clicked.
Any idea why this is happening? Any suggestions ?
Thanks.
image: if you click anywhere inside the red button, the top left button of the nav bar still gets pressed.
code for nav bar button:
UIButton *leftButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 25, 25)];
[leftButton setShowsTouchWhenHighlighted:NO];
[leftButton setImage:[UIImage imageNamed:@"deals.png"] forState:UIControlStateNormal];
[leftButton setImage:[UIImage imageNamed:@"deals_down.png"] forState:UIControlStateSelected];
[leftButton setImage:[UIImage imageNamed:@"deals_down.png"] forState:UIControlStateHighlighted];
[leftButton addTarget:self action:@selector(dealsButtonPressed:) forControlEvents:UIControlEventTouchDown || UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:leftButton] autorelease];
[leftButton release];