I'm trying to create a UI with two button bars (top and bottom) inside the detail view of a NavigationSplitView, instead of using the built-in .toolbar() modifier. I'm using .ignoresSafeArea(.container, edges: .vertical) so the detail view can reach into that area.
However, in macOS and iOS 26 the top button is not clickable/tappable because it is behind an invisible View created by the non-existent toolbar. Interestingly enough, if I apply .buttonStyle(.borderless) to the top button it becomes clickable (in macOS).
On the iPad the behavior is different depending on the iPad OS version. In iOS 26, the button is tappable only by the bottom half. In iOS 18 the button is always tappable.
Here's the code for the screenshot:
import SwiftUI
struct ContentView2: View {
@State private var sidebarSelection: String?
@State private var contentSelection: String?
@State private var showContentColumn = true
@State private var showBars = true
var body: some View {
NavigationSplitView {
// Sidebar
List(selection: $sidebarSelection) {
Text("Show Content Column").tag("three")
Text("Hide Content Column").tag("two")
}
.navigationTitle("Sidebar")
} detail: {
VStack(spacing: 0) {
if showBars {
HStack {
Button("Click Me") {
withAnimation {
showBars.toggle()
}
}
.buttonStyle(.borderedProminent)
}
.frame(maxWidth: .infinity, minHeight: 50, idealHeight: 50, maxHeight: 50)
.background(.gray)
.transition(.move(edge: .top))
}
ZStack {
Text("Detail View")
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .init(horizontal: .center, vertical: .center))
.border(.red)
.onTapGesture(count: 2) {
withAnimation {
showBars.toggle()
}
}
if showBars {
HStack {
Button("Click Me") {
withAnimation {
showBars.toggle()
}
}
}
.frame(maxWidth: .infinity, minHeight: 50, idealHeight: 50, maxHeight: 50)
.background(.gray)
.transition(.move(edge: .bottom))
}
}
.ignoresSafeArea(.container, edges: .vertical)
.toolbarVisibility(.hidden)
}
.toolbarVisibility(.visible)
}
}
I'm confused by this very inconsistent behavior and I haven't been able to find a way to get this UI to work across both platforms.
Does anybody know how to remove the transparent toolbar that is preventing clicks/taps in this top section of the view? I'm hoping there's an idiomatic, native SwiftUI way to do it.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
On iPadOS 26 (up to beta 7), .sheet backgrounds have a dark green tint on Dark Mode and a gray tint on Light Mode. This is clearly noticeable on both the Canvas/Simulator and a physical device.
Here's a sample View that shows the issue:
import SwiftUI
struct ContentView: View {
@State private var isPresenting: Bool = false
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
Button("Show Sheet") {
isPresenting.toggle()
}
}
.sheet(isPresented: $isPresenting) {
VStack {
HStack {
Spacer()
Button("Cancel", systemImage: "xmark.circle.fill") {
}
.foregroundStyle(.secondary)
.labelStyle(.iconOnly)
.buttonStyle(.plain)
.contentShape(.circle)
}
TabView {
Tab("Tab 1", systemImage: "cart") {
Text("Hello, tab 1")
}
Tab("Tab 2", systemImage: "cart") {
Text("Hello, tab 2")
}
}
}
.scenePadding()
}
.padding()
.preferredColorScheme(.dark)
}
}
#Preview {
ContentView()
}
Is this the expected behavior with the new OS? Anyone else seeing this?
Topic:
UI Frameworks
SubTopic:
SwiftUI