Permalink
Browse files

Added support for "ScrollsToTop"; navigate back to top of long page b…

…y tapping the device status bar (iOS expected behavior)
  • Loading branch information...
1 parent 49cb69f commit 22e129f196a0ad5386aa67e693a19cdb3aa19139 @argentini argentini committed Jan 20, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 TSMiniWebBrowser/TSMiniWebBrowser.m
@@ -269,6 +269,20 @@ - (void)viewDidUnload
[super viewDidUnload];
}
+- (void) viewWillAppear:(BOOL)animated
+{
+ for (id subview in self.view.subviews)
+ {
+ if ([subview isKindOfClass: [UIWebView class]])
+ {
+ UIWebView *sv = subview;
+ [sv.scrollView setScrollsToTop:NO];
+ }
+ }
+
+ [webView.scrollView setScrollsToTop:YES];
+}
+
-(void) viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];

0 comments on commit 22e129f

Please sign in to comment.