【发布时间】:2020-01-17 19:54:50
【问题描述】:
我发现 .listRowBackground(Color.Red.Blush) 可以设置列表行列,但是在列表中有一些空行仍然是白色的。当我在列表上滚动时,它也会显示一些白色区域。有人可以帮助解决这个问题吗?还感谢您告诉我如何使用 SegmentedPickerStyle 更改颜色。该视频显示了我的问题。 https://youtu.be/aEPw5hHBkFE 谢谢!
struct UserNotificationCellView: View {
@ObservedObject var userNotification: UserNotification
@ObservedObject var userNotifications: UserNotifications
var body: some View {
{
......
}
.padding(.horizontal,20)
.cornerRadius(14)
.listRowBackground(Color.Red.Blush)
// .background(Color.Red.Blush)
}
}
下面是我的列表代码
List {
ForEach(userNotifications1.userNotificationsArray, id: \.notifyId) { (userNotification) in
UserNotificationCellView(userNotification: userNotification,userNotifications: self.userNotifications1)
// .listRowBackground(Color.Red.Blush)
}.colorMultiply(Color.Red.Blush)
Spacer()
}.environment(\.defaultMinListRowHeight, 80)
【问题讨论】:
标签: swiftui swiftui-list