Skip to content

Commit

Permalink
Fix/translucent with default scroll edge (#191)
Browse files Browse the repository at this point in the history
* fix: translucent with default scroll edge

* docs(changeset): fix: make translucent prop work properly with default apperance
  • Loading branch information
okwasniewski authored Dec 12, 2024
1 parent aa04554 commit f681e5e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-snails-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-bottom-tabs': patch
---

fix: make translucent prop work properly with default apperance
12 changes: 9 additions & 3 deletions packages/react-native-bottom-tabs/ios/TabViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ private func configureTransparentAppearance(tabBar: UITabBar, props: TabViewProp

private func configureStandardAppearance(tabBar: UITabBar, props: TabViewProps) {
let appearance = UITabBarAppearance()
tabBar.isTranslucent = props.translucent

// Configure background
switch props.scrollEdgeAppearance {
Expand All @@ -208,8 +207,15 @@ private func configureStandardAppearance(tabBar: UITabBar, props: TabViewProps)
default:
appearance.configureWithDefaultBackground()
}
appearance.backgroundColor = props.barTintColor


if props.translucent == false {
appearance.configureWithOpaqueBackground()
}

if props.barTintColor != nil {
appearance.backgroundColor = props.barTintColor
}

// Configure item appearance
let itemAppearance = UITabBarItemAppearance()
let fontSize = props.fontSize != nil ? CGFloat(props.fontSize!) : tabBarDefaultFontSize
Expand Down

0 comments on commit f681e5e

Please sign in to comment.