Skip to content

Commit f681e5e

Browse files
authored
Fix/translucent with default scroll edge (#191)
* fix: translucent with default scroll edge * docs(changeset): fix: make translucent prop work properly with default apperance
1 parent aa04554 commit f681e5e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.changeset/curly-snails-crash.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: make translucent prop work properly with default apperance

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ private func configureTransparentAppearance(tabBar: UITabBar, props: TabViewProp
199199

200200
private func configureStandardAppearance(tabBar: UITabBar, props: TabViewProps) {
201201
let appearance = UITabBarAppearance()
202-
tabBar.isTranslucent = props.translucent
203202

204203
// Configure background
205204
switch props.scrollEdgeAppearance {
@@ -208,8 +207,15 @@ private func configureStandardAppearance(tabBar: UITabBar, props: TabViewProps)
208207
default:
209208
appearance.configureWithDefaultBackground()
210209
}
211-
appearance.backgroundColor = props.barTintColor
212-
210+
211+
if props.translucent == false {
212+
appearance.configureWithOpaqueBackground()
213+
}
214+
215+
if props.barTintColor != nil {
216+
appearance.backgroundColor = props.barTintColor
217+
}
218+
213219
// Configure item appearance
214220
let itemAppearance = UITabBarItemAppearance()
215221
let fontSize = props.fontSize != nil ? CGFloat(props.fontSize!) : tabBarDefaultFontSize

0 commit comments

Comments
 (0)