CB-5594 Add disallowoverscroll option.
Similar to the main cordova webview
This commit is contained in:
parent
25d152b578
commit
f75b30857b
@ -54,6 +54,7 @@
|
||||
@property (nonatomic, assign) BOOL keyboarddisplayrequiresuseraction;
|
||||
@property (nonatomic, assign) BOOL suppressesincrementalrendering;
|
||||
@property (nonatomic, assign) BOOL hidden;
|
||||
@property (nonatomic, assign) BOOL disallowoverscroll;
|
||||
|
||||
+ (CDVInAppBrowserOptions*)parseOptions:(NSString*)options;
|
||||
|
||||
|
@ -149,6 +149,18 @@
|
||||
}
|
||||
self.inAppBrowserViewController.modalTransitionStyle = transitionStyle;
|
||||
|
||||
// prevent webView from bouncing
|
||||
if (browserOptions.disallowoverscroll) {
|
||||
if ([self.inAppBrowserViewController.webView respondsToSelector:@selector(scrollView)]) {
|
||||
((UIScrollView*)[self.inAppBrowserViewController.webView scrollView]).bounces = NO;
|
||||
} else {
|
||||
for (id subview in self.inAppBrowserViewController.webView.subviews) {
|
||||
if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
|
||||
((UIScrollView*)subview).bounces = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UIWebView options
|
||||
self.inAppBrowserViewController.webView.scalesPageToFit = browserOptions.enableviewportscale;
|
||||
@ -852,6 +864,7 @@
|
||||
self.keyboarddisplayrequiresuseraction = YES;
|
||||
self.suppressesincrementalrendering = NO;
|
||||
self.hidden = NO;
|
||||
self.disallowoverscroll = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
Loading…
Reference in New Issue
Block a user