banner: float below nav bar (no glass pass-through) + slide-up dismiss
Position the floating banner just below the nav bar so it no longer overlays the iOS 26 Liquid Glass back/toolbar chrome behind it — tapping retry can no longer also select the control beneath. Banner now slides up + fades on dismiss/timeout (one style for all notifications); full-rect contentShape for a solid tap target.
This commit is contained in:
@@ -482,14 +482,22 @@ struct ContentView: View {
|
||||
}
|
||||
|
||||
private var mainContent: some View {
|
||||
GeometryReader { geo in
|
||||
ZStack(alignment: .top) {
|
||||
rootTabView
|
||||
if let banner = activeBanner {
|
||||
// Floating above the tabs: overlays content, never pushes it.
|
||||
// Floating just below the nav bar: overlays content (never
|
||||
// pushes it) and stays clear of the iOS 26 nav/toolbar
|
||||
// Liquid Glass chrome so a tap on the banner can't also
|
||||
// trigger the control behind it.
|
||||
floatingBanner(banner)
|
||||
.padding(.top, 6)
|
||||
.transition(.asymmetric(insertion: .move(edge: .top).combined(with: .opacity),
|
||||
removal: .opacity))
|
||||
.padding(.top, geo.safeAreaInsets.top + 52)
|
||||
.transition(.asymmetric(
|
||||
insertion: .move(edge: .top).combined(with: .opacity),
|
||||
// Slide up + fade on dismiss/timeout (one style for all).
|
||||
removal: .move(edge: .top).combined(with: .opacity)
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
.animation(.spring(response: 0.3, dampingFraction: 0.8), value: activeBanner)
|
||||
@@ -600,6 +608,7 @@ struct ContentView: View {
|
||||
)
|
||||
.padding(.horizontal, 12)
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityLabel(accessibilityLabel)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user