Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To disable the scroll of UIWebView :</p> <pre><code>mWebView = [[UIWebView alloc] initWithFrame:CGRectMake(20, 0, 300, 390)]; mWebView.backgroundColor=[UIColor greenColor]; mWebView.userInteractionEnabled=YES; mWebView.autoresizingMask=YES; mWebView.delegate = self; for (id subview in mWebView.subviews) if ([[subview class] isSubclassOfClass: [UIScrollView class]]) ((UIScrollView *)subview).bounces = NO; for (id subview in mWebView.subviews) if ([[subview class] isSubclassOfClass: [UIScrollView class]]) ((UIScrollView *)subview).showsVerticalScrollIndicator = NO; for (id subview in mWebView.subviews) if ([[subview class] isSubclassOfClass: [UIScrollView class]]) ((UIScrollView *)subview).scrollEnabled= NO; </code></pre> <p>Then add this UIWebView as subview your main UIView or wherever u want.</p> <p>Whenever the data is reloaded the following delegate method of UIWebView is called. So implement the dynamic resizing code inside that.</p> <pre><code>- (void)webViewDidFinishLoad:(UIWebView *)webview{ float webHeight; CGRect frame = webview.frame; frame.size.height = 1; webview.frame = frame; CGSize fittingSize = [webview sizeThatFits:CGSizeZero]; frame.size = fittingSize; webview.frame = frame; webHeight=fittingSize.height; rowHt=webHeight; [aTableView reloadData]; } </code></pre> <p>I have added the UIWebView inside the tableview. So I am calling the reloadData for the tableview and passing the webHeight (new webview height)to the table delegate to the set the row height.Hope this helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload