marinofaggiana 3 سال پیش
والد
کامیت
8fa753e79a

+ 2 - 1
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1295,7 +1295,8 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             header.setTitleSorted(datasourceTitleButton: layoutForView?.titleButtonHeader ?? "")
             header.viewRichWorkspaceHeightConstraint.constant = headerRichWorkspaceHeight
             header.setRichWorkspaceText(richWorkspaceText: richWorkspaceText)
-
+            header.colorBackground = collectionView.backgroundColor
+            
             return header
             
         } else {

+ 11 - 3
iOSClient/Main/Section Header Footer/NCSectionHeaderFooter.swift

@@ -37,6 +37,7 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
     @IBOutlet weak var separatorHeightConstraint: NSLayoutConstraint!
     
     var delegate: NCSectionHeaderMenuDelegate?
+    var colorBackground: UIColor?
     
     private var markdownParser = MarkdownParser()
     private var richWorkspaceText: String?
@@ -46,7 +47,7 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
     override func awakeFromNib() {
         super.awakeFromNib()
         
-        backgroundColor = .clear
+        backgroundColor = colorBackground
 
         buttonSwitch.setImage(UIImage.init(named: "switchList")!.image(color: NCBrandColor.shared.gray, size: 25), for: .normal)
         
@@ -87,11 +88,18 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate
     
     func setGradientColor() {
         
+        var colorStart: UIColor = .black
+        var colorEnd: UIColor = .white
+        
         if traitCollection.userInterfaceStyle == .dark {
-            gradient.colors = [UIColor.init(white: 0, alpha: 0).cgColor, UIColor.black.cgColor]
+            colorStart = UIColor.init(white: 0, alpha: 0)
+            colorEnd = UIColor.black
         } else {
-            gradient.colors = [UIColor.init(white: 1, alpha: 0).cgColor, UIColor.white.cgColor]
+            colorStart = UIColor.init(white: 1, alpha: 0)
+            colorEnd = UIColor.white
         }
+        
+        gradient.colors = [colorStart.cgColor, colorEnd.cgColor]
     }
     
     func setTitleSorted(datasourceTitleButton: String) {