I have initialized a new SwiftUI project for iOS. I wrapped the default NavigationSplitView from SwiftData inside a TabView and ran into the following issue: On an iPad (Air, 13 inch, iPadOs 26), the button to open/close the sidebar shifts downwards while opening or closing the sidebar. When the animation finishes, the button jumps back to the original position.
Here's the code I used inside my ContentView:
var body: some View {
TabView {
Tab("Kategorien", systemImage: "circle.fill") {
NavigationSplitView {
List {
ForEach(items) { item in
NavigationLink {
Text("Item at \(item.timestamp, format: Date.FormatStyle(date: .numeric, time: .standard))")
} label: {
Text(item.timestamp, format: Date.FormatStyle(date: .numeric, time: .standard))
}
}
.onDelete(perform: deleteItems)
}
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
EditButton()
}
ToolbarItem {
Button(action: addItem) {
Label("Add Item", systemImage: "plus")
}
}
}
} detail: {
Text("Select an item")
}
}
Tab("Alle Bücher", systemImage: "circle.fill") {
Text("Alle Bücher")
}
}
}