Skip to content

Instantly share code, notes, and snippets.

@cmenscher
Created June 26, 2013 02:58
Show Gist options
  • Save cmenscher/5864427 to your computer and use it in GitHub Desktop.
Save cmenscher/5864427 to your computer and use it in GitHub Desktop.
Updated code in CVViewController.m file in Cordova XCode project to disable scrollbars when scrolling.
// prevent webView from bouncing
// based on the DisallowOverscroll/UIWebViewBounce key in config.xml
if (!bounceAllowed) {
if ([self.webView respondsToSelector:@selector(scrollView)]) {
((UIScrollView*)[self.webView scrollView]).bounces = NO;
[((UIScrollView*)[self.webView scrollView]) setShowsHorizontalScrollIndicator:NO];
[((UIScrollView*)[self.webView scrollView]) setShowsVerticalScrollIndicator:NO];
} else {
for (id subview in self.webView.subviews) {
if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
((UIScrollView*)subview).bounces = NO;
[((UIScrollView*)subview) setShowsHorizontalScrollIndicator:NO];
[((UIScrollView*)subview) setShowsVerticalScrollIndicator:NO];
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment