开发者

How to add info button to UIToolbar

开发者 https://www.devze.com 2022-12-24 17:22 出处:网络
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 toolb

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

精彩评论

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

关注公众号