Explorar o código

fix (+) tabbarcontroller on iPAD

Marino Faggiana %!s(int64=7) %!d(string=hai) anos
pai
achega
87e2839cb2
Modificáronse 2 ficheiros con 7 adicións e 7 borrados
  1. 1 0
      iOSClient/AppDelegate.h
  2. 6 7
      iOSClient/AppDelegate.m

+ 1 - 0
iOSClient/AppDelegate.h

@@ -145,6 +145,7 @@
 - (void)updateApplicationIconBadgeNumber;
 
 // TabBarController
+- (void)createTabBarController:(UITabBarController *)tabBarController;
 - (void)aspectNavigationControllerBar:(UINavigationBar *)nav online:(BOOL)online hidden:(BOOL)hidden;
 - (void)aspectTabBar:(UITabBar *)tab hidden:(BOOL)hidden;
 - (void)plusButtonVisibile:(BOOL)visible;

+ 6 - 7
iOSClient/AppDelegate.m

@@ -187,7 +187,9 @@
     [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
     
     // Settings TabBar
-    [self createTabBarController];
+    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
+    UITabBarController *tabBarController = [splitViewController.viewControllers firstObject];
+    [self createTabBarController:tabBarController];
     
     // How to hide UINavigationBar 1px bottom line < iOS 11
     [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
@@ -835,16 +837,13 @@
 #pragma mark ===== TabBarController =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)createTabBarController
+- (void)createTabBarController:(UITabBarController *)tabBarController
 {
     UITabBarItem *item;
     NSLayoutConstraint *constraint;
     CGFloat multiplier = 0;
     CGFloat safeAreaBottom = 0;
     
-    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
-    UITabBarController *tabBarController = [splitViewController.viewControllers firstObject];
-    
     if (@available(iOS 11, *)) {
         safeAreaBottom = [UIApplication sharedApplication].delegate.window.safeAreaInsets.bottom/2;
     }
@@ -865,8 +864,8 @@
     
     // (PLUS)
     item = [tabBarController.tabBar.items objectAtIndex: k_tabBarApplicationIndexPlusHide];
-    item.title = nil;
-    item.image = nil;
+    item.title = @"";
+    item.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"tabBarPlus"] color:[UIColor clearColor]];
     item.enabled = false;
     
     // Photos