Note that there are some explanatory texts on larger screens.

plurals
  1. POUIWebView scrollView.contentSize.height not changed
    primarykey
    data
    text
    <p>After load htmlString, contentSize of scrollView in <code>UIWebView</code> don't changed. In other my viewControllers all good, but now it's something mysterious</p> <p>I have</p> <pre><code>UIWebView *contentWebView; </code></pre> <p>I make it in some method</p> <pre><code>- (void)makeContent { ... contentWebView = [[UIWebView alloc] initWithFrame:CGRectMake(5, imageView.originY + imageView.height + 5, mainView.width - 10, 100)]; contentWebView.delegate = self; contentWebView.scrollView.scrollEnabled = NO; contentWebView.contentMode = UIViewContentModeScaleAspectFit; NSLog(@"%@", factDict[@"text"]); [contentWebView loadHTMLString:factDict[@"text"] baseURL:nil]; contentWebView.height = contentWebView.scrollView.contentSize.height; [mainView addSubview:contentWebView]; } - (void)webViewDidFinishLoad:(UIWebView *)webView { NSLog(@"%f %f %f %f ", webView.height, webView.scrollView.contentSize.height, contentWebView.height, contentWebView.scrollView.contentSize.height); [webView sizeToFit]; NSLog(@"%f %f %f %f ", webView.height, webView.scrollView.contentSize.height, contentWebView.height, contentWebView.scrollView.contentSize.height); ... } </code></pre> <p>Early in other controllers <code>contentWebView.height = contentWebView.scrollView.contentSize.height;</code> help me, but now it's not work</p> <p>In log I have next</p> <p><img src="https://i.stack.imgur.com/sI10G.png" alt="enter image description here"></p> <p>So I don\t understand why contentsize.height not changed</p> <p><strong>EDIT</strong></p> <p>In my another viewcontrollers all good</p> <pre><code>- (void)makeScrollView { CGFloat width = [Utils widthOfMainViewForOrientation:self.interfaceOrientation]; [mainView removeFromSuperview]; mainView = [[UIView alloc] initWithFrame:CGRectMake((self.view.width - width) / 2, 15, width, 100)]; mainView.backgroundColor = [UIColor whiteColor]; if ([self.fullInfoDictionary[@"content"] length]) { contentWebView = [[UIWebView alloc] initWithFrame:CGRectMake(6, 4, mainView.width - 12, 100)]; contentWebView.contentMode = UIViewContentModeScaleAspectFit; contentWebView.delegate = self; HelperDf.htmlString = self.fullInfoDictionary[@"content"]; [contentWebView loadHTMLString:self.fullInfoDictionary[@"content"] baseURL:nil]; contentWebView.scrollView.scrollEnabled = NO; [mainView addSubview:contentWebView]; } [self.scrollView addSubview:mainView]; } - (void)webViewDidFinishLoad:(UIWebView *)webView { contentWebView.height = contentWebView.scrollView.contentSize.height; NSLog(@"%f %f %f %f", webView.height, webView.scrollView.contentSize.height, contentWebView.height, contentWebView.scrollView.contentSize.height); [self reloadFrames]; } </code></pre> <p>i have next</p> <p><img src="https://i.stack.imgur.com/W2aYB.png" alt="enter image description here"></p> <p>I get htmlString from this controller</p> <pre><code>HelperDf.htmlString = self.fullInfoDictionary[@"content"]; </code></pre> <p>And set in my first UIWebVIew but results - NO.</p> <p>You can it's no matter if stay <code>contentWebView.scrollView.scrollEnabled = NO;</code> I change to YES, but results are same - in second case all good in first - NO</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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