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
アクションも。ホットスポットの範囲を変更して小さくするにはどうすればよいですか?