I'm trying to understand why would a single button appear twice in the toolbar, like so:
Do you see the eclipsed button peeking from underneath the top button? It's the same button, somehow doubled or cloned, or replicated. To reproduce it, I only needed to create a fresh iOS project in Xcode and apply this code change:
diff --git a/BugRepro20260409/ContentView.swift b/BugRepro20260409/ContentView.swift
index 426b298..d22433f 100644
--- a/BugRepro20260409/ContentView.swift
+++ b/BugRepro20260409/ContentView.swift
@@ -28,7 +28,7 @@ struct ContentView: View {
ToolbarItem(placement: .navigationBarTrailing) {
EditButton()
}
- ToolbarItem {
+ ToolbarItem(placement: .bottomBar) {
Button(action: addItem) {
Label("Add Item", systemImage: "plus")
}
This is all I needed to do for the double-vision button.
Why would this button appear twice when moved to .bottomBar?
By the way, when moved to the side and displayed on a smaller device like iPhone SE, the duplication is quite jarring:
Interestingly, both buttons are active, and both trigger the same code path.
Any ideas what's going on?