Search code examples
uinavigationcontrolleruibarbuttonitemuiappearance

Default back button background image of UIBarButtonItem appears over my custom


In the AppDelegate I'm setting custom back button background image with UIAppearence.

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:image forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:highlightedImage forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];

In some cases after pushing view controller appears default back button background image over my custom.


Solution

  • It helped me to hide default image.

    [[UINavigationBar appearance] setTintColor:[UIColor clearColor]];