Prechádzať zdrojové kódy

Fix tabbar background color

Signed-off-by: Philippe Weidmann <philippe.weidmann@infomaniak.com>
Philippe Weidmann 4 rokov pred
rodič
commit
88ef72db4c
2 zmenil súbory, kde vykonal 12 pridanie a 2 odobranie
  1. 1 1
      iOSClient/AppDelegate.m
  2. 11 1
      iOSClient/Main/NCMainTabBar.swift

+ 1 - 1
iOSClient/AppDelegate.m

@@ -1013,7 +1013,7 @@
                 tabBarController.tabBar.translucent = NO;
                 tabBarController.tabBar.barTintColor = NCBrandColor.sharedInstance.backgroundView;
                 tabBarController.tabBar.tintColor = NCBrandColor.sharedInstance.brandElement;
-                tabBarController.tabBar.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
+                tabBarController.tabBar.backgroundColor = NCBrandColor.sharedInstance.tabBar;
             }
         }
     }

+ 11 - 1
iOSClient/Main/NCMainTabBar.swift

@@ -29,12 +29,22 @@ import Foundation
         return UITraitCollection(horizontalSizeClass: .compact)
     }
 
+    override var backgroundColor: UIColor? {
+        get {
+            return self.fillColor
+        }
+        set {
+            fillColor = newValue
+        }
+    }
+    
+    private var fillColor: UIColor!
     private var shapeLayer: CALayer?
 
     private func addShape() {
         let shapeLayer = CAShapeLayer()
         shapeLayer.path = createPath()
-        shapeLayer.fillColor = NCBrandColor.sharedInstance.tabBar.cgColor
+        shapeLayer.fillColor = backgroundColor?.cgColor
 
 
         if let oldShapeLayer = self.shapeLayer {