Explorar o código

local network: disable gradients within dividers on iOS 7+

Felix Paul Kühne %!s(int64=11) %!d(string=hai) anos
pai
achega
b01cfd90c5
Modificáronse 1 ficheiros con 9 adicións e 7 borrados
  1. 9 7
      Sources/VLCLocalServerListViewController.m

+ 9 - 7
Sources/VLCLocalServerListViewController.m

@@ -349,13 +349,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;