Commit d305adff authored by Felix Paul Kühne's avatar Felix Paul Kühne

menu: disable gradients in dividers on iOS 7+

parent 0dc630eb
...@@ -235,13 +235,15 @@ ...@@ -235,13 +235,15 @@
UIView *headerView = nil; UIView *headerView = nil;
if (headerText != [NSNull null]) { if (headerText != [NSNull null]) {
headerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.height, 21.0f)]; headerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.height, 21.0f)];
CAGradientLayer *gradient = [CAGradientLayer layer]; if (!SYSTEM_RUNS_IOS7_OR_LATER) {
gradient.frame = headerView.bounds; CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.colors = @[ gradient.frame = headerView.bounds;
(id)[UIColor colorWithRed:(66.0f/255.0f) green:(66.0f/255.0f) blue:(66.0f/255.0f) alpha:1.0f].CGColor, gradient.colors = @[
(id)[UIColor colorWithRed:(56.0f/255.0f) green:(56.0f/255.0f) blue:(56.0f/255.0f) alpha:1.0f].CGColor, (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]; ];
[headerView.layer insertSublayer:gradient atIndex:0];
}
UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectInset(headerView.bounds, 12.0f, 5.0f)]; UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectInset(headerView.bounds, 12.0f, 5.0f)];
textLabel.text = (NSString *) headerText; textLabel.text = (NSString *) headerText;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment