'How to resize header inside NavigationLink view in SwiftUI
I am currently trying to resize the top of the view when a NavigationLink is opened. As you can see from my screenshot, it's somehow double and there is a line separating the header. Do you know how I could get rid of the part above the back arrow?
This is my code
NavigationView{
List(presenter.sections, id: \.self) { section in
Section(header: Text(section.title)) {
ForEach(section.items, id: \.self) { item in
NavigationLink("\(item.selectModel.title) \(item.selectModel.selectedValue?.name ?? "")") {
List{
ForEach(selectModel.listSelection, id: \.self) { value in
Button(action: {selectModel.action(value)}) {
VStack(alignment: .leading) {
Text(value.name)
.foregroundColor(.black)
}
.contentShape(Rectangle())
.cornerRadius(12)
}
}
}
.offset(y: 50)
}
.navigationBarTitle(selectModel.title, displayMode: .inline)
.navigationBarHidden(true)
}
}
}
}
.navigationBarTitle("TEST", displayMode: .inline)
.navigationBarHidden(true)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
