SwiftUI,如何在黑暗模式下自定义背景颜色?

时间:2020-08-17 10:11:13

标签: list background swiftui separator darkmode

我使用的customColor具有明暗模式的定义

enter image description here

这是List

    public var body: some View {
        List {
            ForEach(Array(1...5), id: \.self) {
                Text(String($0))
                    .listRowBackground(Color(.customColor))
                    .background(Color(.customColor))

            }
        }
    }

我的问题是分隔符后面的背景颜色仍然是黑色,在黑暗模式下看起来真的很糟糕

enter image description here

enter image description here

有人知道如何解决此问题吗?

0 个答案:

没有答案