How to restrict rightBarButtonItem size in UINavigationBar ?

Posted by lefakir on Stack Overflow See other posts from Stack Overflow or by lefakir
Published on 2010-04-26T08:46:56Z Indexed on 2010/04/27 0:33 UTC
Read the original article Hit count: 379

I create a rightBarButtonItem with this method :

- (UIBarButtonItem *)customBarButtonWithSelector:(SEL)callback {
 UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
 customButton.bounds = CGRectMake(0, 0, 30.0f, 30.0f);
 return [[[UIBarButtonItem alloc] initWithCustomView:customButton] autorelease];
}

At execution time the selector is fired when the bar is touched outside the button (near the middle).

Is there a way to restrict the event responder in the defined bounds or in a acceptable range ?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uikit