UIView *leftButtonItemView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
UIImageView *addButtonEmptyImage = [[UIImageView alloc]init];
[addButtonEmptyImage setImage:[UIImage imageNamed:@"black.png"]];
addButtonEmptyImage.frame = CGRectMake(15,0,20,30);
[leftButtonItemView addSubview:addButtonEmptyImage];
[addButtonEmptyImage release];
UIImageView *correctButtonEmptyImage = [[UIImageView alloc]init];
[correctButtonEmptyImage setImage:[UIImage imageNamed:@"black.png"]];
correctButtonEmptyImage.frame = CGRectMake(50,0,20,30);
[leftButtonItemView addSubview:correctButtonEmptyImage];
[correctButtonEmptyImage release];
UIBarButtonItem *leftButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftButtonItemView];
[leftButtonItemView release];
self.navigationItem.leftBarButtonItem = leftButtonItem;
[leftButtonItem release];
This is some source of my app. I know NavigationItem has two buttons(left and right). But I hope to make three buttons. so I make one button which use navigationItem and the other button which use a blank view. I want to click correctButtonEmptyImage. But this is in leftButtonItemView. namely, If I clicked the view which contains two images, I woud have seen leftButtonItemView not correctButtonEmptyImage. help me. thanks