I need to add info button to toolbar.
can any one help me开发者_如何学Python to solve this.
Thanks in advance.
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];
Create the info image, then use -initWithImage:style:target:action:
.
精彩评论