Browse Source

fix https://github.com/nextcloud/ios/issues/476

Marino Faggiana 7 năm trước cách đây
mục cha
commit
875fdb4a3f
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 13 0
      iOSClient/Main/CCMainTabBarController.swift

+ 13 - 0
iOSClient/Main/CCMainTabBarController.swift

@@ -85,6 +85,19 @@ class CCMainTabBarController : UITabBarController, UITabBarControllerDelegate {
             self.view.isUserInteractionEnabled = true
         })
     }
+}
 
+//
+// https://stackoverflow.com/questions/44822558/ios-11-uitabbar-uitabbaritem-positioning-issue/46348796#46348796
+//
+extension UITabBar {
+    // Workaround for iOS 11's new UITabBar behavior where on iPad, the UITabBar inside
+    // the Master view controller shows the UITabBarItem icon next to the text
+    override open var traitCollection: UITraitCollection {
+        if UIDevice.current.userInterfaceIdiom == .pad {
+            return UITraitCollection(horizontalSizeClass: .compact)
+        }
+        return super.traitCollection
+    }
 }