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
446
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
342
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.6k
Sep ’22
Searchable FocusState
Hello, is there a way to set the focus on the search bar without the user clicking on it? Just like with the @FocusState for Textfields but for the new .searchable modifier. Thanks, Jonas
2
4
854
Jul ’22
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()         }     } }
Replies
0
Boosts
0
Views
446
Activity
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()     } }
Replies
0
Boosts
0
Views
342
Activity
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)
Replies
3
Boosts
0
Views
1.6k
Activity
Sep ’22
Searchable FocusState
Hello, is there a way to set the focus on the search bar without the user clicking on it? Just like with the @FocusState for Textfields but for the new .searchable modifier. Thanks, Jonas
Replies
2
Boosts
4
Views
854
Activity
Jul ’22
macOS sidebar transparent highlight (swiftUI)
Hello, i would like to have the sidebar items highlighted transparently just like in the Finder or Music app. I tried to change the accent color and also have the list style as SidebarListStlye(). Best Regards Jonas
Replies
1
Boosts
1
Views
577
Activity
Feb ’22
Cannot find 'Table' in scope
I opened the Session1 - Part1 - End file. In the "GardenDetail" view in the "Navigation" Folder of the project Xcode throws the error "cannot find 'Table' in scope". I did not changed anything from the original tutorial and have Xcode 13 and BigSur 11.6 on a M1 Mac.
Replies
4
Boosts
0
Views
2.1k
Activity
Oct ’21