Stop UIWebView from bouncing vertically?
for (id subview in webView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
...seems to work fine.
It'll be accepted to App Store as well.
Update: in iOS 5.x+ there's an easier way - UIWebView
has scrollView
property, so your code can look like this:
webView.scrollView.bounces = NO;
Same goes for WKWebView
.
How to Stop UIWebView from “bouncing” vertically scrolling bottom?
You can try like this :
override func viewDidLoad() {
super.viewDidLoad()
webview.scrollView.delegate = self
}
func scrollViewDidScroll(scrollView: UIScrollView) {
if (scrollView.contentOffset.y >= scrollView.contentSize.height - scrollView.frame.size.height) {
scrollView.setContentOffset(CGPointMake(scrollView.contentOffset.x, scrollView.contentSize.height - scrollView.frame.size.height), animated: false)
}
}
Set the delegate of your webview and set the content offset of the webview's scrollview
Ref taken from: https://stackoverflow.com/a/14084747/4557505
How to stop UIWebView bouncing vertically in phonegap 3.0
Make certain changes in config.xml
,
If you are using it for Android, then use
And for IOS, use like
Hope this helps you.
EDIT
Do a cordova build
after you have made changes in the config.xml
file so that the changes affect to your project. The above steps would solve your problem only after you do a cordova build
Avoid uiwebview so much vertical scrolling
Are you using iOS5? If so then:
webView.scrollview.bounces = NO;
If you're not using iOS5, then you can search through the webView's subviews for the UIScrollView (isKindOfClass) and then set the bounces property.
In iOS in UIWeb view disable vertical scroll bounce?
alwaysBounceVertical and alwaysBounceHorizonal is set to NO
by default, so your code have no effect.
Instead, you need to set bounces
to NO, to disable bouncing, i.e.
self.wwTicket.scrollView.bounces = NO;
You can optionally also disable scrolling entirely, if your WebView frame and content are of the same size, i.e.
self.wwTicket.scrollView.scrollEnabled = NO;
Related Topics
Custom Annotation View for Userlocation Not Moving the Mapview
Swiftui Mvvm Coordinator/Router/Navigationlink
Disable iOS8 Quicktype Keyboard Programmatically on Uitextview
Strange Generic Function Appear in View Controller After Converting to Swift 3
How to Use Bluetooth Classic Instead of Le
Expandable Tableview in Iphone
Is Nstimer Expected to Fire When App Is Backgrounded
Prompt When Trying to Dial a Phone Number Using Tel:// Scheme on iOS 10.3
High Quality Scaling of Uiimage
iOS 9 Facebook Login Simulator -Canopenurl: Failed for Url: "Fbauth2:///" - Error: "(Null)"
Decoding JSON Web Tokens in Swift
Swift Compiler Shows Expected Declaration Error
Retrieve All Contacts Phone Numbers in iOS
Xcode Beta 6 iOS 8: Simulator Not Working
iOS Uinavigationbar Button Remains Faded After Segue Back