Hi,
I have to have two buttons on the right side of the navigation bar. So i created a tool bar and added two bar button items to its content view. Like below.
UIBarButtonItem *shareButton = [[UIBarButtonItem alloc]
initWithImage:[UIImage imageNamed:@"share-icon-32x32.png"]
style:UIBarButtonItemStyleBordered
target:self action:@selector(showShare)];
shareButton.width = 30.0f;
[buttons addObject:shareButton];
[shareButton release];
where buttons is an array holding the button objects.
Like wise i have another barbutton item like below
UIBarButtonItem *addButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(addDescription)];
addButton.style = UIBarButtonItemStyleBordered;
[buttons addObject:addButton];
[addButton release];
Now add the array to the toolbar like below
[toolbar setItems:buttons animated:YES];
[buttons release];
and add it to the rightBarButton like below
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithCustomView:toolbar];
[toolbar release];
I am getting two bar button items on the right bar but i am not able to get the image displayed on to the share button item. Its just a white patch. Can any body tell me what am i doing wrong or how to get the image displayed.
Regards,
Syed Yusuf