6

I have a NavigationView that contains a ScrollView with a large title. When I navigate to a page with an inline title, then navigate back, the title stays inline rather than reverting to the large title.

This only occurs in iOS 15 - in iOS 14 the title reverts back to the large title as desired. Is there a way to achieve the desired behavior in iOS 15?

Here's an example that illustrates the behavior:

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationView {
            ScrollView {
                NavigationLink("Link", destination: DestinationView())
                    .padding()
            }
            .navigationBarTitle("Home", displayMode: .large)
        }
    }
}

struct DestinationView: View {
    var body: some View {
        Text("Destination")
            .navigationBarTitle("test", displayMode: .inline)
    }
}
sia
  • 256
  • 3
  • 14
  • 2
    I can verify. Seems like a bug. It even happens with the new `navigationTitle` and `navigationBarTitleDisplayMode` that are meant for use in iOS 14+. `navigationBarTitle` was deprecated. – lorem ipsum Jul 06 '21 at 00:32
  • 1
    This seems to be fixed, I can't reproduce it. Can you test it again? – George Sep 24 '21 at 01:19
  • Confirmed that this is fixed in the release version of iOS 15. I had filed a feedback that they responded to back in August, so hopefully that helped encourage them to fix it. – sia Sep 24 '21 at 23:59

0 Answers0