Browse Source

menu: disable gradients in dividers on iOS 7+

Felix Paul Kühne 11 years ago
parent
commit
d305adff40
1 changed files with 9 additions and 7 deletions
  1. 9 7
      Sources/VLCMenuTableViewController.m

+ 9 - 7
Sources/VLCMenuTableViewController.m

@@ -235,13 +235,15 @@
 	UIView *headerView = nil;
 	if (headerText != [NSNull null]) {
 		headerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.height, 21.0f)];
-		CAGradientLayer *gradient = [CAGradientLayer layer];
-		gradient.frame = headerView.bounds;
-		gradient.colors = @[
-                      (id)[UIColor colorWithRed:(66.0f/255.0f) green:(66.0f/255.0f) blue:(66.0f/255.0f) alpha:1.0f].CGColor,
-                      (id)[UIColor colorWithRed:(56.0f/255.0f) green:(56.0f/255.0f) blue:(56.0f/255.0f) alpha:1.0f].CGColor,
-                      ];
-		[headerView.layer insertSublayer:gradient atIndex:0];
+        if (!SYSTEM_RUNS_IOS7_OR_LATER) {
+            CAGradientLayer *gradient = [CAGradientLayer layer];
+            gradient.frame = headerView.bounds;
+            gradient.colors = @[
+                          (id)[UIColor colorWithRed:(66.0f/255.0f) green:(66.0f/255.0f) blue:(66.0f/255.0f) alpha:1.0f].CGColor,
+                          (id)[UIColor colorWithRed:(56.0f/255.0f) green:(56.0f/255.0f) blue:(56.0f/255.0f) alpha:1.0f].CGColor,
+                          ];
+            [headerView.layer insertSublayer:gradient atIndex:0];
+        }
 
 		UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectInset(headerView.bounds, 12.0f, 5.0f)];
 		textLabel.text = (NSString *) headerText;