Skip to content

Instantly share code, notes, and snippets.

@ryanmcgrath
Created March 17, 2012 03:08
Show Gist options
  • Save ryanmcgrath/2054634 to your computer and use it in GitHub Desktop.
Save ryanmcgrath/2054634 to your computer and use it in GitHub Desktop.
Swap this in PhoneGap/Callback iOS apps, stops rubberbanding effects at native level instead of JS crap.
- (void)webViewDidStartLoad:(UIWebView *)theWebView
{
for (id subview in theWebView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]]) {
((UIScrollView *)subview).bounces = NO;
((UIScrollView *)subview).showsVerticalScrollIndicator = NO;
}
return [ super webViewDidStartLoad:theWebView ];
}
@newacct
Copy link

newacct commented Jun 4, 2012

[[subview class] isSubclassOfClass: [UIScrollView class]]

should be written as

[subview isKindOfClass: [UIScrollView class]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment