我用这个方法创建了一个 rightBarButtonItem:
- (UIBarButtonItem *)customBarButtonWithSelector:(SEL)callback {
UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
customButton.bounds = CGRectMake(0, 0, 30.0f, 30.0f);
return [[[UIBarButtonItem alloc] initWithCustomView:customButton] autorelease];
}
在执行时,当在按钮外部(靠近中间)触摸条时触发选择器。
有没有办法将事件响应者限制在定义的范围内或可接受的范围内?