How to add info button in UIToolbar

I need to add an info button to the toolbar.

can someone help me solve this.

Thanks in advance.

+4
source share
2 answers

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

 UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; UIBarButtonItem *infoButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:infoButton] autorelease]; myToolbar.items = [NSArray arrayWithObjects:infoButtonItem, nil]; 
+13
source

Create an informational image, then use -initWithImage:style:target:action:

0
source

Source: https://habr.com/ru/post/1305341/


All Articles