SwiftUI 导航标题重叠
SwiftUI Navigation title overlapping
导航进出 SwiftUI 导航屏幕后标题重叠。这是我的代码。
NavigationView {
List {
ForEach(productCategories) { index in
NavigationLink(destination: AllProductsList(categoryID: index.categoryID, categoryTitle: index.name)) {
ZStack(alignment: .bottomLeading) {
VStack {
WebImage(url: URL(string: serviceLink + "/image/" + index.image))
.resizable()
.indicator(.activity)
.aspectRatio(contentMode: .fill)
.frame(width: screen.width - 30, height: 300, alignment: .center)
.clipShape(RoundedRectangle(cornerRadius: 30, style: .continuous))
}
Text(index.name)
.font(.system(size: 40, weight: .bold, design: .rounded))
.foregroundColor(.white)
.padding()
}
}
}
}
.navigationTitle(Text("Kategoriler"))
.navigationBarTitleDisplayMode(.large)
我解决了问题
.isDetaillink(false)
我需要将它添加到导航的末尾Link
导航进出 SwiftUI 导航屏幕后标题重叠。这是我的代码。
NavigationView {
List {
ForEach(productCategories) { index in
NavigationLink(destination: AllProductsList(categoryID: index.categoryID, categoryTitle: index.name)) {
ZStack(alignment: .bottomLeading) {
VStack {
WebImage(url: URL(string: serviceLink + "/image/" + index.image))
.resizable()
.indicator(.activity)
.aspectRatio(contentMode: .fill)
.frame(width: screen.width - 30, height: 300, alignment: .center)
.clipShape(RoundedRectangle(cornerRadius: 30, style: .continuous))
}
Text(index.name)
.font(.system(size: 40, weight: .bold, design: .rounded))
.foregroundColor(.white)
.padding()
}
}
}
}
.navigationTitle(Text("Kategoriler"))
.navigationBarTitleDisplayMode(.large)
我解决了问题
.isDetaillink(false)
我需要将它添加到导航的末尾Link