【发布时间】:2021-06-05 07:57:06
【问题描述】:
Xcode 12 / Swift 5 / SwiftUI
如何在 NavigationView 内的表单中删除每个文本标签之间的分隔符?
我有这个,但每个文本之间还有一个分隔符,如何删除它?
struct ContentView: View {
init() {
UITableView.appearance().sectionHeaderHeight = .zero
UITableView.appearance().backgroundColor = UIColor.white
UITableView.appearance().separatorStyle = .none
}
var body: some View {
NavigationView {
Form {
Section(){
Text("\(isbn ?? "")")
Text("\(foundBooks?.items.first?.volumeInfo.line1 ?? "")")
Text("\(foundBooks?.items.first?.volumeInfo.line2 ?? "")")
Text("\(foundBooks?.items.first?.volumeInfo.line3 ?? "")")
Text("\(foundBooks?.items.first?.volumeInfo.line4 ?? "")")
Text("\(foundBooks?.items.first?.volumeInfo.line5 ?? "")")
Text("\(foundBooks?.items.first?.volumeInfo.line6 ?? "")")
}
}
}
}
}
我虽然在 init 内部 UITableView.appearance().separatorStyle = .none 行会这样做,但它不会
添加什么代码以及在哪里删除每个Text()...之间的分隔符
【问题讨论】:
标签: xcode forms swiftui sections navigationview