Skip to content

Commit 9940e8e

Browse files
authored
feat: make tabview backgroudn transparent (#402)
1 parent 144316a commit 9940e8e

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.changeset/dull-walls-share.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+
feat: make tabview background transparent

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ struct TabViewImpl: View {
5656
}
5757
#endif
5858
.introspectTabView { tabController in
59+
tabController.view.backgroundColor = .clear
60+
tabController.viewControllers?.forEach { $0.view.backgroundColor = .clear }
5961
#if os(macOS)
6062
tabBar = tabController
6163
#else

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public final class TabInfo: NSObject {
4545
}
4646

4747
@objc public class TabViewProvider: PlatformView {
48-
private var delegate: TabViewProviderDelegate?
48+
private weak var delegate: TabViewProviderDelegate?
4949
private var props = TabViewProps()
5050
private var hostingController: PlatformHostingController<TabViewImpl>?
5151
private var coalescingKey: UInt16 = 0
@@ -212,6 +212,7 @@ public final class TabInfo: NSObject {
212212

213213
if let hostingController = self.hostingController, let parentViewController = reactViewController() {
214214
parentViewController.addChild(hostingController)
215+
hostingController.view.backgroundColor = .clear
215216
addSubview(hostingController.view)
216217
hostingController.view.translatesAutoresizingMaskIntoConstraints = false
217218
hostingController.view.pinEdges(to: self)

0 commit comments

Comments
 (0)