Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIWebView prevents UITableView to scroll

I have a cell in my UITableView with a UIWebView. The problem is that if you swipe on the UIWebView you swipe throughout the internet page, and not the table view. Since the web view has a hight of 500, it is possible that the user is stuck in the web view. Does anyone have any ideas in how to solve the problem?

like image 769
Alessandro Avatar asked Mar 22 '23 03:03

Alessandro


1 Answers

Beginning with iOS 5, there is a scrollView property on UIWebView, so you can just do the following on your web view:

webView.scrollView.scrollEnabled = NO; 
webView.scrollView.bounces = NO;

Then you should be able to scroll just fine. No need to disable interaction on the web view, unless you don't want the user to be able to interact with it at all.

like image 157
Gavin Avatar answered Apr 06 '23 09:04

Gavin