I am encountering a critical issue where a custom background image on a UIToolbar fails to display when the app is built with Xcode 26 and run on iOS 26 beta. The exact same implementation works perfectly on iOS 18 and earlier versions.
We first attempted to use the legacy setBackgroundImage method, which fails to render the image on iOS 26:
// 1. Get Navigation Bar and set basic properties
UINavigationBar* navBar = self.navigationBar;
navBar.hidden = NO;
navBar.translucent = NO;
// 2. Setup the UIToolbar instance UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:navBar.bounds]; toolBar.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
// 3. Set the resizable image (This image does not appear on iOS 26) UIImage* imagePortrait = [UIImage imageNamed:@"nav_bg"]; UIEdgeInsets insets = UIEdgeInsetsMake(0.f, 6.f, 0.f, 6.f);
[toolBar setBackgroundImage:[imagePortrait resizableImageWithCapInsets:insets] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
We then migrated to the recommended modern UIToolbarAppearance to solve this, but the issue persists:
// 1. Prepare Image UIImage* imagePortrait = [UIImage imageNamed:@"nav_bg"]; // Insets are applied via resizableImageWithCapInsets: (not shown in this snippet but implied)
// 2. Configure UIToolbarAppearance UIToolbarAppearance *appearance = [[UIToolbarAppearance alloc] init];
appearance.backgroundImage = imagePortrait; // The image is correctly loaded (not nil)
// 3. Apply the Appearance toolBar.standardAppearance = appearance; // We also applied to scrollEdgeAppearance and compactAppearance.
Any information or recommended workarounds for displaying a custom background image on UIToolbar in the latest iOS 26 would be highly appreciated.