开发者

How to add info button to UIToolbar

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:.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜