in case of create the List with Swift UI I have uncontrollable background of the List
Looks like there is absent "native" way to change background color of List background color.
How to make it transparent?
(Answer is below)
the following code makes ALL OF List
s background color transparent:
// Removes background from List in SwiftUI
extension NSTableView {
open override func viewDidMoveToWindow() {
super.viewDidMoveToWindow()
backgroundColor = NSColor.clear
enclosingScrollView!.drawsBackground = false
}
}
the following code makes ALL OF TextEditor
s background color transparent:
extension NSTextView {
open override var frame: CGRect {
didSet {
backgroundColor = .clear //<<here clear
drawsBackground = true
}
}
}