【发布时间】:2021-03-31 11:45:11
【问题描述】:
在 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)
【问题讨论】:
-
上面的代码对我来说很好用。也许也可以从目标视图中显示您的代码?
标签: swift swiftui navigation