iOS
自定义UINavigationItem leftBarButtonItem
热点范围太大
UIButton *modalViewButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage* imagex = [UIImage imageNamed:@"btn_backX1.png"];
[modalViewButton addTarget:self
action:@selector(backAction:)
forControlEvents:UIControlEventTouchUpInside];
[modalViewButton setImage:[UIImage imageNamed:@"btn_backX1.png"] forState:UIControlStateNormal];
//image size is 35X34
[modalViewButton setFrame:CGRectMake(0, 0, imagex.size.width, imagex.size.height)];
UIBarButtonItem *modalBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:modalViewButton];
self.navigationItem.leftBarButtonItem = modalBarButtonItem;
[modalBarButtonItem release];
当我单击UIView
左上角下UINavigationBar
的leftBarButtonItem
时,将执行此操作。如果我点击中间UINavigationBar
,leftBarButtonItem
动作也是如此。如何修改热点范围以使其更小?