Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found something that worked for me. The problem is that when uiwebview changes its orientation web contents are zoommed to fit with viewport. But zoomscale parameter of scrollview subview is not updated correctly (nor are updated minimumZoomScale nor maximumZoomScale</p> <p>Then we need to do it manually at <code>willRotateToInterfaceOrientation</code>:</p> <pre><code>- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { CGFloat ratioAspect = webview.bounds.size.width/webview.bounds.size.height; switch (toInterfaceOrientation) { case UIInterfaceOrientationPortraitUpsideDown: case UIInterfaceOrientationPortrait: // Going to Portrait mode for (UIScrollView *scroll in [webview subviews]) { //we get the scrollview // Make sure it really is a scroll view and reset the zoom scale. if ([scroll respondsToSelector:@selector(setZoomScale:)]){ scroll.minimumZoomScale = scroll.minimumZoomScale/ratioAspect; scroll.maximumZoomScale = scroll.maximumZoomScale/ratioAspect; [scroll setZoomScale:(scroll.zoomScale/ratioAspect) animated:YES]; } } break; default: // Going to Landscape mode for (UIScrollView *scroll in [webview subviews]) { //we get the scrollview // Make sure it really is a scroll view and reset the zoom scale. if ([scroll respondsToSelector:@selector(setZoomScale:)]){ scroll.minimumZoomScale = scroll.minimumZoomScale *ratioAspect; scroll.maximumZoomScale = scroll.maximumZoomScale *ratioAspect; [scroll setZoomScale:(scroll.zoomScale*ratioAspect) animated:YES]; } } break; } } </code></pre> <p>Hope this helps!</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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