Navigation title scroll along with the content in iOS 26. working fine in iOS 18 and below. One of my UI component is outside the scrollview which is causing the issue.
var body: some View {
VStack {
Rectangle()
.frame(maxWidth: .infinity)
.frame(height: 60)
.padding(.horizontal)
.padding(.top)
ScrollView {
ForEach(0...5, id: \.self) { _ in
RoundedRectangle(cornerRadius: 10)
.fill(.green)
.frame(maxWidth: .infinity)
.frame(height: 100)
.padding(.horizontal)
}
}
}
.navigationTitle("Hello World")
}
}
In iOS 26, the navigation bar's large-title collapse behavior requires a ScrollView as the direct content of the view. When you wrap the ScrollView in a VStack alongside other views, the system can't connect the scroll position to the title transition, so the title scrolls away with the content.
Move your Rectangle out of the VStack and use safeAreaInset instead:
ScrollView {
ForEach(0...5, id: \.self) { _ in
RoundedRectangle(cornerRadius: 10)
.fill(.green)
.frame(maxWidth: .infinity)
.frame(height: 100)
.padding(.horizontal)
}
}
.safeAreaInset(edge: .top) {
Rectangle()
.frame(maxWidth: .infinity)
.frame(height: 60)
.padding(.horizontal)
}
.navigationTitle("Hello World")
This keeps the ScrollView as the primary content so the title collapse works correctly, while safeAreaInset places your Rectangle above the scroll region without interfering.