UIBarButtonItem
will not allow you to put background image.
Try to use normal UIButton
and try to use image as a background to the UIButton
.
Get the action of the UIButton
and you will get your desired output.
add images to UIBarButtonItem of toolbar in ios
-
28-06-2022 - |
Question
I have a UIBarButtonItem
that does not take the picture
I have a toolbar with a button UIBarButtonItem
above, connected via IBOutlet
. The image that I put you do not see.
My code:-
@interface ViewController : {
IBOutlet UIToolbar *toolBar;
IBOutlet UIBarButtonItem * myBackButton;
IBOutlet UIBarButtonItem * myReloadButton;
IBOutlet UIBarButtonItem * myHomeButton;
IBOutlet UIBarButtonItem * myListButton;
IBOutlet UIBarButtonItem * myCalendarbutton;//the problem is this
}
the button is connect by IB
but does not take the picture.
this is the image
this is the IB
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow