Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dull-walls-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-bottom-tabs': patch
---

feat: make tabview background transparent
2 changes: 2 additions & 0 deletions packages/react-native-bottom-tabs/ios/TabViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
}
#endif
.introspectTabView { tabController in
tabController.view.backgroundColor = .clear
tabController.viewControllers?.forEach { $0.view.backgroundColor = .clear }
#if os(macOS)
tabBar = tabController
#else
Expand Down Expand Up @@ -117,7 +119,7 @@
}
#endif


Check warning on line 122 in packages/react-native-bottom-tabs/ios/TabViewImpl.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Vertical Whitespace Violation: Limit vertical whitespace to a single empty line; currently 2 (vertical_whitespace)
#if !os(macOS)
private func configureTransparentAppearance(tabBar: UITabBar, props: TabViewProps) {
tabBar.barTintColor = props.barTintColor
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native-bottom-tabs/ios/TabViewProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
}

@objc public protocol TabViewProviderDelegate {
func onPageSelected(key: String, reactTag: NSNumber?)

Check warning on line 41 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
func onLongPress(key: String, reactTag: NSNumber?)

Check warning on line 42 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
func onTabBarMeasured(height: Int, reactTag: NSNumber?)

Check warning on line 43 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
func onLayout(size: CGSize, reactTag: NSNumber?)

Check warning on line 44 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
}

@objc public class TabViewProvider: PlatformView {
private var delegate: TabViewProviderDelegate?
private weak var delegate: TabViewProviderDelegate?
private var props = TabViewProps()
private var hostingController: PlatformHostingController<TabViewImpl>?
private var coalescingKey: UInt16 = 0
Expand All @@ -57,7 +57,7 @@
@objc var onTabBarMeasured: RCTDirectEventBlock?
@objc var onNativeLayout: RCTDirectEventBlock?

@objc public var icons: NSArray? {

Check warning on line 60 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
didSet {
loadIcons(icons)
}
Expand Down Expand Up @@ -87,7 +87,7 @@
}
}

@objc public var selectedPage: NSString? {

Check warning on line 90 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
didSet {
props.selectedPage = selectedPage as? String
}
Expand All @@ -99,13 +99,13 @@
}
}

@objc public var scrollEdgeAppearance: NSString? {

Check warning on line 102 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
didSet {
props.scrollEdgeAppearance = scrollEdgeAppearance as? String
}
}

@objc public var minimizeBehavior: NSString? {

Check warning on line 108 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
didSet {
props.minimizeBehavior = MinimizeBehavior(rawValue: minimizeBehavior as? String ?? "")
}
Expand All @@ -117,7 +117,7 @@
}
}

@objc var items: NSArray? {

Check warning on line 120 in packages/react-native-bottom-tabs/ios/TabViewProvider.swift

View workflow job for this annotation

GitHub Actions / swift-lint

Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
didSet {
props.items = parseTabData(from: items)
}
Expand Down Expand Up @@ -212,6 +212,7 @@

if let hostingController = self.hostingController, let parentViewController = reactViewController() {
parentViewController.addChild(hostingController)
hostingController.view.backgroundColor = .clear
addSubview(hostingController.view)
hostingController.view.translatesAutoresizingMaskIntoConstraints = false
hostingController.view.pinEdges(to: self)
Expand Down
Loading