Skip to content

Commit de7264e

Browse files
committed
fix(ios): prevent header showing on iPad when using a custom one
1 parent 93afe39 commit de7264e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.changeset/purple-beers-laugh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-bottom-tabs': patch
3+
---
4+
5+
fix: prevent header showing on iPad when using a custom one

packages/react-native-bottom-tabs/ios/TabViewImpl.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ struct TabViewImpl: View {
101101
}
102102
.tag(tabData?.key)
103103
.tabBadge(tabData?.badge)
104+
.hideTabBar(props.tabBarHidden)
104105
.onAppear {
105106
#if !os(macOS)
106107
updateTabBarAppearance(props: props, tabBar: tabBar)
@@ -351,6 +352,19 @@ extension View {
351352
self
352353
}
353354
}
355+
356+
@ViewBuilder
357+
func hideTabBar(_ flag: Bool) -> some View {
358+
if flag {
359+
if #available(iOS 16.0, *) {
360+
self.toolbar(.hidden, for: .tabBar)
361+
} else {
362+
self
363+
}
364+
} else {
365+
self
366+
}
367+
}
354368

355369
// Allows TabView to use unfilled SFSymbols.
356370
// By default they are always filled.

0 commit comments

Comments
 (0)