Explorar o código

Empty set offset NCActivity

Offset was off when showing empty image in NCShare view

Signed-off-by: Philippe Weidmann <philippe.weidmann@infomaniak.com>
Philippe Weidmann %!s(int64=4) %!d(string=hai) anos
pai
achega
3be381c97d
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      iOSClient/Activity/NCActivity.swift

+ 6 - 2
iOSClient/Activity/NCActivity.swift

@@ -86,8 +86,12 @@ class NCActivity: UIViewController, DZNEmptyDataSetSource, DZNEmptyDataSetDelega
     // MARK: DZNEmpty
     
     func verticalOffset(forEmptyDataSet scrollView: UIScrollView!) -> CGFloat {
-        let height = self.tabBarController?.tabBar.frame.size.height ?? 0
-        return -height
+        if insets.top != 0 {
+            return insets.top - 150
+        } else {
+            let height = self.tabBarController?.tabBar.frame.size.height ?? 0
+            return -height
+        }
     }
 
     func backgroundColor(forEmptyDataSet scrollView: UIScrollView) -> UIColor? {