Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Classes/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.backgroundColor = [UIColor whiteColor];

[HNNetworkActivityController setNetworkActivityBeganBlock:^{
[[UIApplication sharedApplication] retainNetworkActivityIndicator];
Expand Down
15 changes: 11 additions & 4 deletions Classes/Controllers/BrowserController.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ - (void)loadView {
[self updateToolbarItems];

webview = [[UIWebView alloc] initWithFrame:[[self view] bounds]];
webview.backgroundColor = [UIColor whiteColor];
[webview setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
[webview setDelegate:self];
[webview setScalesPageToFit:YES];
Expand Down Expand Up @@ -152,10 +153,6 @@ - (void)viewDidLoad {
[toolbar setFrame:toolbarFrame];
[toolbar setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin];
[[self view] addSubview:toolbar];

CGRect webviewFrame = [[self view] bounds];
webviewFrame.size.height -= toolbarFrame.size.height;
[webview setFrame:webviewFrame];
} else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
CGRect toolbarFrame = [toolbar bounds];
toolbarFrame.size.width = 280.0f;
Expand Down Expand Up @@ -245,6 +242,16 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView {
[[self navigationItem] setTitle:[self pageTitle]];

[self releaseNetworkIndicator];

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
// Update the webview insets.
// We do this after loading the content due to a bug in iOS7+ that will render
// the area outside of the insets as black
UIEdgeInsets webviewInsets = webview.scrollView.contentInset;
webviewInsets.bottom = toolbar.frame.size.height;
webview.scrollView.contentInset = webviewInsets;
webview.scrollView.scrollIndicatorInsets = webview.scrollView.contentInset;
}
}

- (void)webViewDidStartLoad:(UIWebView *)webView {
Expand Down