Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add info button to UIToolbar

Tags:

objective-c

I need to add info button to toolbar.

can any one help me to solve this.

Thanks in advance.

like image 673
Rani Avatar asked Dec 12 '22 23:12

Rani


1 Answers

You need to create a UIButton of type UIButtonTypeInfoLight (or, depending on your toolbar color UIButtonTypeInfoDark). You'd then use this button as the custom view for a UIBarButtonItem:

UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
UIBarButtonItem *infoButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:infoButton] autorelease];
myToolbar.items = [NSArray arrayWithObjects:infoButtonItem, nil];
like image 179
omz Avatar answered Jan 03 '23 16:01

omz