Hi,
Since iOS 18 we now have a built-in "tap on item to scroll to the top" functionality into TabView
, which is great but it does have a UI glitch on real devices, it works correct on simulators running from Xcode.
The real device I am testing is on iOS 18.2.1
It looks like this:
If I then try to scroll the list it snaps back to a offset bellow the navigation title, so fro the looks of it the "scroll to top" was not really to the top but some offset under it.
The View is declared like this:
struct ContentView: View {
private var tabSelection: Binding<String> { Binding(
get: { selectedTab },
set: { selectedTab = $0 }
)}
@State private var selectedTab: String = "Test"
var body: some View {
TabView(selection: tabSelection,
content: {
NavigationStack {
List {
ForEach(0...1000, id: \.self) { index in
Text("Test 1 - Row: \(index)")
}
}
.navigationTitle("Test 1")
}
.listStyle(.insetGrouped)
.tabItem {
Image(systemName: SFSystemName.morning)
Text("Test")
}
.tag("Test")
})
.tabViewStyle(.sidebarAdaptable)
}
}
Any ideas how to resolve this.