Skip to content

Commit 37dbd7c

Browse files
committed
feat: make tabview backgroudn transparent
1 parent 144316a commit 37dbd7c

File tree

4 files changed

+19
-100
lines changed

4 files changed

+19
-100
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

apps/example/ios/Podfile.lock

Lines changed: 10 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ PODS:
11801180
- React-jsiexecutor
11811181
- React-RCTFBReactNativeSpec
11821182
- ReactCommon/turbomodule/core
1183-
- react-native-bottom-tabs (0.9.2):
1183+
- react-native-bottom-tabs (0.10.0):
11841184
- DoubleConversion
11851185
- glog
11861186
- RCT-Folly (= 2024.11.18.00)
@@ -1205,71 +1205,7 @@ PODS:
12051205
- SwiftUIIntrospect (~> 1.0)
12061206
- Yoga
12071207
- react-native-safe-area-context (5.2.0):
1208-
- DoubleConversion
1209-
- glog
1210-
- RCT-Folly (= 2024.11.18.00)
1211-
- RCTRequired
1212-
- RCTTypeSafety
12131208
- React-Core
1214-
- React-debug
1215-
- React-Fabric
1216-
- React-featureflags
1217-
- React-graphics
1218-
- React-ImageManager
1219-
- React-jsi
1220-
- react-native-safe-area-context/common (= 5.2.0)
1221-
- react-native-safe-area-context/fabric (= 5.2.0)
1222-
- React-NativeModulesApple
1223-
- React-RCTFabric
1224-
- React-rendererdebug
1225-
- React-utils
1226-
- ReactCodegen
1227-
- ReactCommon/turbomodule/bridging
1228-
- ReactCommon/turbomodule/core
1229-
- Yoga
1230-
- react-native-safe-area-context/common (5.2.0):
1231-
- DoubleConversion
1232-
- glog
1233-
- RCT-Folly (= 2024.11.18.00)
1234-
- RCTRequired
1235-
- RCTTypeSafety
1236-
- React-Core
1237-
- React-debug
1238-
- React-Fabric
1239-
- React-featureflags
1240-
- React-graphics
1241-
- React-ImageManager
1242-
- React-jsi
1243-
- React-NativeModulesApple
1244-
- React-RCTFabric
1245-
- React-rendererdebug
1246-
- React-utils
1247-
- ReactCodegen
1248-
- ReactCommon/turbomodule/bridging
1249-
- ReactCommon/turbomodule/core
1250-
- Yoga
1251-
- react-native-safe-area-context/fabric (5.2.0):
1252-
- DoubleConversion
1253-
- glog
1254-
- RCT-Folly (= 2024.11.18.00)
1255-
- RCTRequired
1256-
- RCTTypeSafety
1257-
- React-Core
1258-
- React-debug
1259-
- React-Fabric
1260-
- React-featureflags
1261-
- React-graphics
1262-
- React-ImageManager
1263-
- React-jsi
1264-
- react-native-safe-area-context/common
1265-
- React-NativeModulesApple
1266-
- React-RCTFabric
1267-
- React-rendererdebug
1268-
- React-utils
1269-
- ReactCodegen
1270-
- ReactCommon/turbomodule/bridging
1271-
- ReactCommon/turbomodule/core
1272-
- Yoga
12731209
- React-nativeconfig (0.77.1)
12741210
- React-NativeModulesApple (0.77.1):
12751211
- glog
@@ -1557,7 +1493,6 @@ PODS:
15571493
- React-ImageManager
15581494
- React-jsi
15591495
- React-NativeModulesApple
1560-
- React-RCTAppDelegate
15611496
- React-RCTFabric
15621497
- React-rendererdebug
15631498
- React-utils
@@ -1591,29 +1526,6 @@ PODS:
15911526
- ReactCommon/turbomodule/core
15921527
- Yoga
15931528
- RNScreens (4.9.1):
1594-
- DoubleConversion
1595-
- glog
1596-
- RCT-Folly (= 2024.11.18.00)
1597-
- RCTRequired
1598-
- RCTTypeSafety
1599-
- React-Core
1600-
- React-debug
1601-
- React-Fabric
1602-
- React-featureflags
1603-
- React-graphics
1604-
- React-ImageManager
1605-
- React-jsi
1606-
- React-NativeModulesApple
1607-
- React-RCTFabric
1608-
- React-RCTImage
1609-
- React-rendererdebug
1610-
- React-utils
1611-
- ReactCodegen
1612-
- ReactCommon/turbomodule/bridging
1613-
- ReactCommon/turbomodule/core
1614-
- RNScreens/common (= 4.9.1)
1615-
- Yoga
1616-
- RNScreens/common (4.9.1):
16171529
- DoubleConversion
16181530
- glog
16191531
- RCT-Folly (= 2024.11.18.00)
@@ -1695,7 +1607,6 @@ DEPENDENCIES:
16951607
- React-idlecallbacksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/idlecallbacks`)
16961608
- React-ImageManager (from `../node_modules/react-native/ReactCommon/react/renderer/imagemanager/platform/ios`)
16971609
- React-jsc (from `../node_modules/react-native/ReactCommon/jsc`)
1698-
- React-jsc/Fabric (from `../node_modules/react-native/ReactCommon/jsc`)
16991610
- React-jserrorhandler (from `../node_modules/react-native/ReactCommon/jserrorhandler`)
17001611
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
17011612
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
@@ -1931,18 +1842,18 @@ SPEC CHECKSUMS:
19311842
React-logger: e7eeebaed32b88dcc29b10901aa8c5822dc397c4
19321843
React-Mapbuffer: 73dd1210c4ecf0dfb4e2d4e06f2a13f824a801a9
19331844
React-microtasksnativemodule: dece61f766f8d326099d217603b1ebb50d6bb707
1934-
react-native-bottom-tabs: 9cfaa0350a9632efff1e7ce16e732e32f06c6117
1935-
react-native-safe-area-context: 7f3dfe7a0e269ffccac6f1a8377e85e8237b47be
1845+
react-native-bottom-tabs: 9d98ab5aac5500b5686655bb6dfcc78a04f72c3e
1846+
react-native-safe-area-context: 3e33e7c43c8b74dba436a5a32651cb8d7064c740
19361847
React-nativeconfig: cb207ebba7cafce30657c7ad9f1587a8f32e4564
19371848
React-NativeModulesApple: 38f252170af5351c88bc2e94d697359cd8c031e6
19381849
React-perflogger: c4c3b7c18f8a50cdbe2bcdd2f15705ba029a5a02
19391850
React-performancetimeline: 38bda258bd9f9da19b27615e8edfbec064aa42cc
19401851
React-RCTActionSheet: 0fdf55fb8724856d63ca8c63cdb4e2325e15e8ec
19411852
React-RCTAnimation: b2fcc7c462f1fb5e195a5547f6e405ec9a60d80f
1942-
React-RCTAppDelegate: a569d1037a16f4911bcf4d0b874598c7722fe2d5
1853+
React-RCTAppDelegate: 7691b8fe13c1c329cfcb44252cd1abf4409c0fcf
19431854
React-RCTBlob: f6620374c96915ce1762405b1504e607e239c518
1944-
React-RCTFabric: d74ed998450607ebaf701e38969c04d85a54a1b2
1945-
React-RCTFBReactNativeSpec: cf67e0c357ed8de018a1ed5b33a8b258de651f5e
1855+
React-RCTFabric: 8b25a4b9e5b62b4e263a2e85e10bd3215bee6b32
1856+
React-RCTFBReactNativeSpec: bc3fb34e6f7736cabda3c3de2444b928e3a3dd55
19461857
React-RCTImage: f189ae651e3c97879b4cdefcba1d4cffe55439da
19471858
React-RCTLinking: 759ac5e4aed95ac3c29849f98ff3f3b5ece830ed
19481859
React-RCTNetwork: ce1f38434a70eb1e228344f7632e636c3ceca03b
@@ -1961,12 +1872,12 @@ SPEC CHECKSUMS:
19611872
ReactAppDependencyProvider: 41e9fb63606c32cce924653d2d410cb01ec81286
19621873
ReactCodegen: 9cf993a8cfdffca67d5abe1ba056020fc48fc0d4
19631874
ReactCommon: ede76856e587ac3fd7ce70ca2387e571bc947d14
1964-
ReactNativeHost: e48e75303e422f7966cf7dc4b68d4b59d4570217
1875+
ReactNativeHost: 8ef54ff7c6c17c1242e287c286699f8955f22e45
19651876
ReactTestApp-DevSupport: f23bacc6d21da29a7d8d248bb6ee8cc9ad241a48
19661877
ReactTestApp-Resources: 4f6dff3b157f879757cd750caccd1d34a7eda647
1967-
RNGestureHandler: 5efafa1473ccab9c4530bb7310032b784ecc84a6
1968-
RNScreens: 749bdbb62d3dc57bd1373c64eaf5342ea0768178
1969-
RNVectorIcons: 3bcc7d69519bcac82308d2464579c4203a451c28
1878+
RNGestureHandler: 00e35ccf0f6ee047d10d726a6b2c1cf85de54946
1879+
RNScreens: 62107db9c6147f19a6d0e8989f355acae46a99c5
1880+
RNVectorIcons: 5c1b761ed018ba598757d876380e584414befada
19701881
SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8
19711882
SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c
19721883
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748

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)