Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
_tabViewProvider.tabBarHidden = newViewProps.tabBarHidden;
}

if (oldViewProps.ignoresContentBackground != newViewProps.ignoresContentBackground) {
_tabViewProvider.ignoresContentBackground = newViewProps.ignoresContentBackground;
}

[super updateProps:props oldProps:oldProps];
}
Expand Down
23 changes: 23 additions & 0 deletions packages/react-native-bottom-tabs/ios/TabViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct TabViewImpl: View {
var body: some View {
tabContent
.tabBarMinimizeBehavior(props.minimizeBehavior)
.ignoresContentBackground(props.ignoresContentBackground, barTintColor: props.barTintColor)
#if !os(tvOS) && !os(macOS) && !os(visionOS)
.onTabItemEvent { index, isLongPress in
let item = props.filteredItems[safe: index]
Expand Down Expand Up @@ -325,4 +326,26 @@ extension View {
self
}
}

/// Disables iOS 26 liquid glass content sampling and uses a solid background instead.
/// When enabled, the tab bar will use the specified barTintColor (or system default if nil)
/// instead of dynamically sampling colors from the content behind it.
@ViewBuilder
func ignoresContentBackground(_ ignores: Bool, barTintColor: PlatformColor?) -> some View {
#if compiler(>=6.2)
if #available(iOS 26.0, *) {
if ignores {
self
.toolbarBackgroundVisibility(.visible, for: .tabBar)
.toolbarBackground(barTintColor.map { Color($0) } ?? Color(.systemBackground), for: .tabBar)
} else {
self
}
} else {
self
}
#else
self
#endif
}
}
1 change: 1 addition & 0 deletions packages/react-native-bottom-tabs/ios/TabViewProps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class TabViewProps: ObservableObject {
@Published var fontFamily: String?
@Published var fontWeight: String?
@Published var tabBarHidden: Bool = false
@Published var ignoresContentBackground: Bool = false

var selectedActiveTintColor: PlatformColor? {
if let selectedPage,
Expand Down
12 changes: 12 additions & 0 deletions packages/react-native-bottom-tabs/src/TabView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ interface Props<Route extends BaseRoute> {
* @default 'locale'
*/
layoutDirection?: LayoutDirection;
/**
* When true, disables iOS 26 liquid glass content sampling and uses a solid
* background color (from tabBarStyle.backgroundColor) instead of dynamically
* sampling colors from the content behind the tab bar. (iOS 26+ only)
*
* Use this when you have dynamic content (like maps) where the liquid glass
* effect causes the tab bar to have inconsistent or unreadable colors.
*
* @platform ios
* @default false
*/
ignoresContentBackground?: boolean;
}

const ANDROID_MAX_TABS = 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface TabViewProps extends ViewProps {
fontFamily?: string;
fontWeight?: string;
fontSize?: Int32;
ignoresContentBackground?: boolean;
}

export default codegenNativeComponent<TabViewProps>('RNCTabView', {
Expand Down