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

enter image description here

this is the IB

enter image description here

enter image description here

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top