Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScrollViews at the bottom of NavigationStack cause the navigation title to be invisible in iOS 26

I have a NavigationStack that contains a ScrollView at the bottom of the screen.

struct ContentView: View {
    var body: some View {
        NavigationStack {
            VStack {
                Text("Some Content")
                Spacer()
                ScrollView {
                    VStack {
                        ForEach(0..<20) { _ in
                            Text("Some text")
                                .containerRelativeFrame(.horizontal)
                        }
                    }
                }
                .frame(height: 200)
                
            }
            .navigationTitle("Foo")
        }
    }
}

In iOS 18, this works as expected. In iOS 26 beta 1 however, the navigation title "Foo" is invisible, until I scroll down. This doesn't make sense. A scroll view at the bottom of the screen can somehow affect the navigation title. They are as far apart as they can be!

I thought this is one of the "scroll edge effects" introduced in iOS 26, but the navigation title is still invisible after putting .scrollEdgeEffectDisabled() on the scroll view.

How can I make the navigation title visible?

like image 215
Sweeper Avatar asked Dec 18 '25 15:12

Sweeper


2 Answers

The way the navigation title becomes visible during scrolling suggests that only the large title is "broken" - SwiftUI is still able to display an inline title.

Adding

.navigationBarTitleDisplayMode(.inline)

to the VStack makes the navigation title visible. Of course, the side effect of this is that it removes the large navigation title, which could be undesirable.

like image 193
Sweeper Avatar answered Dec 21 '25 07:12

Sweeper


I was able to fix this issue by removing our UINavigationBarAppearance override from our Theme class.

like image 26
JohnnyRedTruss Avatar answered Dec 21 '25 05:12

JohnnyRedTruss



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!