0
 NavigationView { ScrollView{ .navigationTitle("Home") .toolbar { ToolbarItemGroup(placement: .bottomBar) { VStack{ HStack{ NavigationLink( destination: Home(), label: { Image(systemName: "house") .resizable() .frame(width: 25.0, height: 20.0) .foregroundColor(.blue) .padding() }) } } 

I cant use NavigationLink(destination : Text("Go home page"),label:{}

It is menu bar I want to freeze this menu bar when I scroll down or up

Thank you so much

2
  • Is your view wrapped in a NavigationView? Commented Mar 19, 2021 at 10:11
  • 1
    Can you share the complete SwiftUI view you are using in a way we can test it? You must update your question to be clearer for the community to help you out. Commented Mar 19, 2021 at 10:18

1 Answer 1

1
import SwiftUI struct HomeNav: View { @State var isActiveHome: Bool = false var body: some View { NavigationView { ScrollView{ Text("Main") NavigationLink( destination: Text("Home").navigationTitle("Home"), isActive: $isActiveHome, label: { Image(systemName: "house") .resizable() .frame(width: 25.0, height: 20.0) .foregroundColor(.blue) .padding() }).hidden().frame(width: 0, height: 0, alignment: .center) .navigationTitle("Main") .toolbar { ToolbarItemGroup(placement: .bottomBar) { VStack{ HStack{ Button(action: { isActiveHome = true }, label: { Image(systemName: "house") .resizable() .frame(width: 25.0, height: 20.0) .foregroundColor(.blue) .padding() }) } } } } } } } } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.