Hi, I know its a simple thing, but I cannot figure it out.
I have a list of items going to another view using NavigationStack. Everything seems fine, but when I go into the list, I have two back buttons, the title is shifted down, and its just annoying.
Thanks for the help.
Here's my code:
struct ImportantNumbers: View {
var body: some View {
NavigationStack {
List(INDDataService.getAll(), id: \.id) { data in
NavigationLink(value: data)
{
HStack {
Image(systemName: "circle.fill")
.foregroundColor(.green)
Text(data.name)
.fontWeight(.bold)
.navigationTitle("Important U.S. ADA Numbers")
.navigationBarTitleDisplayMode(.inline)
}
.navigationDestination(for: INDData.self) { data in
Spacer()
Image(data.logo)
.resizable()
.frame(width: 200, height: 200)
Spacer()
Text(data.phone)
.font(.system(size: 30, weight: .bold, design: .rounded))
Spacer()
.navigationTitle(data.name)
}
}
}
}
}
}
struct ImportantNumbers_Previews: PreviewProvider {
static var previews: some View {
ImportantNumbers()
}
}