Right now, the traffic light buttons overlapped on my iPad app top corner on windows mode (full screen is fine).
How do I properly design my app to avoid the traffic light buttons? Detect that it is iPadOS 26?
Right now, the traffic light buttons overlapped on my iPad app top corner on windows mode (full screen is fine).
How do I properly design my app to avoid the traffic light buttons? Detect that it is iPadOS 26?
You can't eliminate the traffic light but you can specify its style a bit.
In UIKit you can implement the UIWindowSceneDelegate
method preferredWindowingControlStyle(for:)
and return one of three styles.
I don't know the SwiftUI equivalent.
I filed FB18559686 for this, and was just discussing the same issue over in https://developer.apple.com/forums/thread/790994
I posted a sort-of solution in https://developer.apple.com/forums/thread/790994 that shows a mostly working way to detect the frame of the window controls
I found that I could use the containerCornerInsets
on the GeometryProxy
to get this frame. (https://developer.apple.com/documentation/swiftui/geometryproxy/containercornerinsets)
Here is my code where I added a red rectangle behind the controls.
GeometryReader { geo in
NavigationSplitView(columnVisibility: $sceneModel.columnVisibility) {
GPSidebarView(appModels: self.appModels())
.sceneWidth(geo.size.width)
} detail: {
ZStack(alignment: .topLeading) {
GPRootContentViewIOS26(appModels: self.appModels())
.cardStackVisible(sceneModel.hasCardOnMainStack)
Rectangle()
.fill(.red)
.frame(width: geo.containerCornerInsets.topLeading.width, height: geo.containerCornerInsets.topLeading.height)
.ignoresSafeArea()
}
}
}
When I added this with the red rectangle here is what I get for the red rectangle.
Then when my iPad app goes full screen I get