Post

Replies

Boosts

Views

Activity

Navigation title inline after navigating back
Hello, I would like tow have a large navigationTitle style after going back from the sub view. The issue is caused by the searchable modifier. import SwiftUI struct SearchTest: View {     @State var query: String = ""     var body: some View {         List {             NavigationLink("One") {                 Text("I need a large navigation title...")             }         }         .searchable(text: $query, placement: .navigationBarDrawer(displayMode: .always))         .navigationTitle("Test")     } } struct SearchTest_Previews: PreviewProvider {     static var previews: some View {         NavigationStack {             SearchTest()         }     } }
0
0
306
Nov ’22
Navigation Title display mode changes unintentionally
Hello, I would like that the navigation title "View 1" stays large after going to a subview and back. The problem only occurs with a searchable modifier with the always shown settings. Any ideas? struct NavigationTestView: View {     var body: some View {         TabView {             NavigationStack {                 List {                     NavigationLink {                         Text("Sub View")                             .navigationTitle("View 2")                     } label: {                         Text("press me")                     }                 }                 .navigationTitle("View 1")                 .searchable(text: .constant(""), placement: .navigationBarDrawer(displayMode: .always))             }             .tabItem {                 Label("TestView", systemImage: "testtube.2")             }         }     } } struct NavigationTestView_Previews: PreviewProvider {     static var previews: some View {         NavigationTestView()     } }
0
0
257
Oct ’22
NavigationLink in macOS app
Hello, I am trying to use a NavigationLink in my macOS app. The problem is that the destination View is shown as a "speech bubble" and not as new normal View in the app. Here is a sample code to replicate the problem... import SwiftUI struct MainView: View {     var body: some View {         NavigationView {             Text("Sidebar")             NavigationLink(destination: SubView()) {                 Text("click me")             }         }     } } struct SubView: View {     var body: some View {         Text("Hello, World!")     } } // Preview struct MainView_Previews: PreviewProvider {     static var previews: some View {         MainView()     } } If the NavigationLink is in the Sidebar it works as intended (normal new View)
3
0
1.4k
Oct ’21