Browse Source

fix title

Marino Faggiana 6 years ago
parent
commit
e3c0a9e177
2 changed files with 9 additions and 5 deletions
  1. 7 4
      iOSClient/Media/CCMedia.m
  2. 2 1
      iOSClient/Utility/CCGraphics.m

+ 7 - 4
iOSClient/Media/CCMedia.m

@@ -179,15 +179,18 @@
     }
     
     // Title
-    self.navigationItem.titleView = nil;
+    NSString *title;
     if (folder.length == 0) {
-        self.navigationItem.title = NSLocalizedString(@"_media_", nil);
+        title = NSLocalizedString(@"_media_", nil);
     } else {
-        self.navigationItem.title = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"_media_", nil), [folder substringFromIndex:1]];
+        title = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"_media_", nil), [folder substringFromIndex:1]];
     }
     
+    self.navigationItem.titleView = nil;
+    self.navigationItem.title = title;
+    
     if (isSearchMode) {
-        [CCGraphics addImageToTitle:self.navigationItem.title colorTitle:[NCBrandColor sharedInstance].brandText imageTitle:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"load"] multiplier:2 color:[NCBrandColor sharedInstance].brandText] imageRight:YES navigationItem:self.navigationItem];
+        [CCGraphics addImageToTitle:title colorTitle:[NCBrandColor sharedInstance].brandText imageTitle:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"load"] multiplier:2 color:[NCBrandColor sharedInstance].brandText] imageRight:YES navigationItem:self.navigationItem];
     }
     
     // Button Item RIGHT

+ 2 - 1
iOSClient/Utility/CCGraphics.m

@@ -351,7 +351,8 @@ Color difference is determined by the following formula:
     UIView *navView = [UIView new];
     
     UILabel *label = [UILabel new];
-    if (imageRight) title = [@"  " stringByAppendingString:title];
+    if (imageRight)
+        title = [NSString stringWithFormat:@"     %@", title];
     label.text = title;
     [label sizeToFit];
     label.center = navView.center;