UiBarButtonItem image does not display until first click

In my AppDelegate.m file, I created the following feedback button style:

UIImage *backBtnImage = [UIImage imageNamed:@"back.png"]; [[UIBarButtonItem appearance] setBackButtonBackgroundImage: backBtnImage forState: UIControlStateNormal barMetrics: UIBarMetricsDefault]; [[UIBarButtonItem appearance] setBackButtonBackgroundImage: backBtnImage forState: UIControlStateHighlighted barMetrics: UIBarMetricsDefault]; 

For some reason, the background image is displayed only on each view after a space, when the button is pressed once - it is loaded every time for each view after that.

I tried to clear the project, but to no avail.

+4
source share
1 answer

Hmm, if your running this on the simulator, try reinstalling the contents and settings, if it doesnโ€™t work, I know the iOS device has some caching problems, try changing the name.png photo as in the real file and the link in xcode.

0
source

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


All Articles