views:

929

answers:

3

Hello,

how can i add 2 buttons into the uinavivationbar without IB? The 2 buttons should be align on the right side of the uinavigationbar.

I know how i can add one button, but two??

Alex

+3  A: 

You can create a UIView and add two buttons in that view. And add that UIView as right button :)

UIView* rightItem = [UIView alloc] initWithFrame:frame];
//Create UIButton1 b1
//Create UIButton2 b2
[rightItem addSubview:b1];
[rightItem addSubview:b2];

self.navigationItem.rightBarButtonItem = rightItem;
Prakash
Big thanks, prakash!
Alexander