How to add UIBarButtonItemin UIToolbarboth text and image? Take a look at the image that I will show. This is exactly what I'm trying to do.
UIBarButtonItem
UIToolbar
First of all, create a UIButton with an image and a name.
Then add this button to BarButtonItem
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:customButton];
add a custom toolbar for the toolbar, set this property to this button, add a label to the button for text
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
You must create UIViewwith UILabeland UIImageas subzones. Then create UIBarButtonItemwith a custom view:
UIView
UILabel
UIImage
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:customView];
Several link links will help you embed the UIBarButtonItem in a UIToolbar with text and image .... You simply change the code to suit your requirements.
UIToolbar UIBarButtonItem with image and title has very dim text
add image to UIBarButtonItem for UIToolbar