Skip to content

Commit 4eeae14

Browse files
authored
fix(iOS, Tabs): tabBarTintColor on iPadOS (#3314)
## Description Fixes setting tint color for the tab bar on iPadOS (>= 18). <img width="2064" height="2752" alt="Simulator Screenshot - iPad Pro 13-inch (M4) - 2025-10-20 at 14 09 05" src="https://github.com/user-attachments/assets/7efe321a-29c0-4eb0-b027-d87185cdcc7b" /> `tabBar.tintColor` does not work for the floating tab bar. [Apple recommends](https://developer.apple.com/forums/thread/761056?answerId=798245022#798245022) setting the tint color for the `UITabBarController`'s view - that's what we do in this PR. Unfortunately, when using the sidebar, tint color is set after a delay. This is also reproducible in a native UIKit app and has been mentioned in the same forum thread from the link above to happen [in native iPadOS apps (e.g. Numbers)](https://developer.apple.com/forums/thread/761056?answerId=798343022#798343022). https://github.com/user-attachments/assets/8e1e0d9f-91be-47ce-9712-a80030bf3b9b ## Changes - set tint color for `tabBarController.view` ## Test code and steps to reproduce Run `TestBottomTabs` on an iPad. ## Checklist - [x] Included code example that can be used to test this change - [ ] Ensured that CI passes
1 parent eed4e11 commit 4eeae14

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ios/bottom-tabs/RNSTabBarAppearanceCoordinator.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#import <React/RCTImageLoader.h>
44
#import "RCTConvert+RNSBottomTabs.h"
55
#import "RNSConversions.h"
6+
#import "RNSTabBarController.h"
67
#import "RNSTabsScreenViewController.h"
78

89
@implementation RNSTabBarAppearanceCoordinator
@@ -19,6 +20,10 @@ - (void)updateAppearanceOfTabBar:(nullable UITabBar *)tabBar
1920
// Step 1 - configure host-specific appearance
2021
tabBar.tintColor = hostComponentView.tabBarTintColor;
2122

23+
// Set tint color for iPadOS tab bar. This is the official way recommended by Apple:
24+
// https://developer.apple.com/forums/thread/761056?answerId=798245022#798245022
25+
hostComponentView.controller.view.tintColor = hostComponentView.tabBarTintColor;
26+
2227
if (tabScreenCtrls == nil) {
2328
return;
2429
}

0 commit comments

Comments
 (0)