Iām operating right into a structure situation with ToolbarTitleMenu in SwiftUI.
After I add a ToolbarTitleMenu to an inline navigation title, the title not truncates and as a substitute takes precedence over the trailing toolbar objects, inflicting them to be truncated or moved into overflow. If I take away the title menu, the title truncates appropriately and all trailing toolbar objects stay seen.
import SwiftUI
struct ContentView: View {
var physique: some View {
NavigationStack {
Textual content("Good day")
.navigationTitle("Hellooooooooooooooooooooooooo")
.toolbarTitleDisplayMode(.inline)
.toolbar {
ToolbarTitleMenu { }
ToolbarItemGroup(placement: .topBarTrailing) {
Picture(systemName: "particular person")
Picture(systemName: "plus")
Picture(systemName: "pencil")
}
}
}
}
}
-
With
ToolbarTitleMenucurrent:- The navigation title doesn’t truncate
- Trailing toolbar objects get truncated/pushed offscreen
-
With out
ToolbarTitleMenu:- The title truncates as anticipated
- All trailing toolbar objects stay seen
How can I get SwiftUI to permit the navigation title to truncate whereas nonetheless utilizing ToolbarTitleMenu, in order that the toolbar objects do not get pushed offscreen?

