Skip to content

Commit

Permalink
Fix translucent navigation bar on paywalls by making it fully transpa…
Browse files Browse the repository at this point in the history
…rent (on iOS 16+)
  • Loading branch information
joshdholtz committed Dec 5, 2024
1 parent 9e60fd2 commit 907ddf0
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions RevenueCatUI/PaywallView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,26 @@ struct LoadedOfferingPaywallView: View {
}
}


if self.displayCloseButton {
NavigationView {
view
.toolbar {
self.makeToolbar(
color: self.getCloseButtonColor(configuration: configuration)
)
}
// Prevents navigation bar from being showing as translucent
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) {
view
.toolbar {
self.makeToolbar(
color: self.getCloseButtonColor(configuration: configuration)
)
}
.toolbarBackground(.hidden, for: .navigationBar)
} else {
view
.toolbar {
self.makeToolbar(
color: self.getCloseButtonColor(configuration: configuration)
)
}
}
}
.navigationViewStyle(.stack)
} else {
Expand Down

0 comments on commit 907ddf0

Please sign in to comment.