My webview app doesn't scroll down. I tried with this code:
webview.scrollView.scrollEnabled = true
but it doesn't work.
Must I to put my webview app into a scrollview app or the webview app is enough? I already tried it but it doesn't work until now.
My whole code in ViewController.swift is:
import UIKit
class ViewController: UIViewController {
@IBOutlet var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
//creo una costante di tipo NSURL
let url = NSURL(string: "http://www.apple.com")
//creo una richiesta di accesso a quello specifico indirizzo
let request = NSURLRequest(URL: url!)
//abilito lo zoom nella webView
webView.scalesPageToFit = true
webView.scrollView.scrollEnabled = true
//carico la richiesta a quell'URL e aggiorna la WebView
webView.loadRequest(request)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
For scrolling of webview view you should check given three step :
1) webview view should be : webView.userInteractionEnabled = true
2) webview view should be : webview.scrollView.scrollEnabled = true
3) webview view content should be more than your webview frame .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With