UIWebView does not scroll

There is no scroll down in my webpage application. I tried with this code:

webview.scrollView.scrollEnabled = true 

but that will not work.

Should I put the webview app in the scrollview app or is the webview app enough? I already tried, but it does not work so far.

All my code in ViewController.swift:

 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. } } 
+4
source share
2 answers

Just add this line to your code:

 webView.userInteractionEnabled = true 

And it will work fine.

+6
source

To scroll through the webview, you must check three steps:

1) the view of the web view should be: webView.userInteractionEnabled = true

2) the view of the web view should be: webview.scrollView.scrollEnabled = true

3) the content of the web view should be larger than your web frame.

+6
source

All Articles