From 494216be999f303abe8ba9da78bcf4c0235dc1fe Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 11 Jun 2014 07:56:12 -0700 Subject: Bring back the UITableViewStyleGrouped color hack. --- CyteKit/ViewController.mm | 11 ++--------- CyteKit/WebViewController.mm | 7 +++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CyteKit/ViewController.mm b/CyteKit/ViewController.mm index a573150..839d2bd 100644 --- a/CyteKit/ViewController.mm +++ b/CyteKit/ViewController.mm @@ -121,16 +121,9 @@ extern bool IsWildcat_; } - (void) setPageColor:(UIColor *)color { - if (color == nil) { + if (color == nil) color = [UIColor groupTableViewBackgroundColor]; - // on iOS 6 they removed groupTableViewBackgroundColor (it is present on iOS 5 and iOS 6) - if ([color isEqual:[UIColor clearColor]]) { - if (!IsWildcat_) // on devices that aren't iPads, we can just fall back to pinStripeColor - color = [UIColor pinStripeColor]; - else // I don't remember where I got this color, but it is only an approximation of a gradient - color = [UIColor colorWithRed:(215.0/255.0) green:(217.0/255.0) blue:(223.0/255.0) alpha:1.0]; - } - } color_ = color; + color_ = color; } @end diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 374cbef..d392fe8 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -1004,6 +1004,13 @@ float CYScrollViewDecelerationRateNormal; [self setViewportWidth:width_]; + if ([[UIColor groupTableViewBackgroundColor] isEqual:[UIColor clearColor]]) { + UITableView *table([[[UITableView alloc] initWithFrame:[webview_ bounds] style:UITableViewStyleGrouped] autorelease]); + [table setScrollsToTop:NO]; + [webview_ insertSubview:table atIndex:0]; + [table setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + } + [webview_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; ready_ = false; -- cgit v1.2.3