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

local network: disable gradients within dividers on iOS 7+

parent d305adff
......@@ -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;
......
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