【发布时间】:2021-10-27 15:03:25
【问题描述】:
我希望我的 TableView 变得透明以便看到渐变背景。我试过 ListRowBackground 但它不起作用。我错过了什么吗? 如果除了我的背景之外,我还想在我的 Tableview 中添加另一个渐变,我应该如何进行?谢谢。
结构测试:查看 {
init() {
UITableView.appearance().backgroundColor = UIColor.clear
UITableViewCell.appearance().backgroundColor = .clear
UITableView.appearance().separatorStyle = .none
}
var body: some View {
NavigationView {
ZStack {
LinearGradient(gradient: Gradient(colors: [Color.red, Color.blue]), startPoint: .top, endPoint: .bottom)
.edgesIgnoringSafeArea(.all)
.overlay(
List(iphonedata) { data in
CompleteCell(contact: data)
}
)
}
.navigationTitle("Version signées")
}
}
}
【问题讨论】:
-
"Translucide background for List" 英文中的“Translucide”是什么意思?你的意思是“半透明”?
-
@El Tomato ,透明,不上色
标签: ios swiftui background cell gradient