Hello,
I have a simple SwiftUI view that shows this bottom bar in the view and I noticed that in SwiftUI previews the 2D window is squared off while in the simulator it has rounded edges. This effects the bottom bar because as you can see in the simulator the text is cut off. I am using Xcode 16 beta and visionOS 2 beta.
Why do the two windows look different? And I am surprised the text is getting cut off in the rounded window.
SwiftUI Preview:
Vision Pro Simulator
Hi @klinee101
The reason you see this behavior is because the preview is a preview of the view not of the app. The view itself doesn't have rounded edges (unless you do that manually), but the app will due to the way apps look on the system. To show this, do something like this:
struct ContentView: View {
var body: some View {
Rectangle().fill(.black)
.padding()
}
}
#Preview(windowStyle: .automatic) {
ContentView()
}
You'll see that the padding makes the black rectangle smaller and you can now see the curved-edge glass background effect behind the view.
If you'd expect different behavior, please file a feedback report at https://feedbackassistant.apple.com with what you'd expect and why, because that information is always incredibly helpful to provide & can help inform the future of the platform! Paste that number here if you do so.
Thanks,
Sydney