Iphone 在其UIWebview iPad中安装内容

Iphone 在其UIWebview iPad中安装内容,iphone,ipad,uiwebview,height,epub,Iphone,Ipad,Uiwebview,Height,Epub,我对iPad的开发还不熟悉 我制作了epub reader并在我的webview中加载了epub的每个页面,当我看到我的应用程序在纵向模式下滚动时不存在,因为我使用了 webview.scalesPageToFit=TRUE 当我在横向滚动中看到我的应用程序时,是否有我使用过的 webview.scalesPageToFit=TRUE 我不想滚动,我想内容,以适应根据屏幕大小 这是我的代码片段: - (void) adjustViewsForOrientation:(UIInterfaceOri

我对iPad的开发还不熟悉

我制作了epub reader并在我的webview中加载了epub的每个页面,当我看到我的应用程序在纵向模式下滚动时不存在,因为我使用了

webview.scalesPageToFit=TRUE

当我在横向滚动中看到我的应用程序时,是否有我使用过的

webview.scalesPageToFit=TRUE

我不想滚动,我想内容,以适应根据屏幕大小

这是我的代码片段:

- (void) adjustViewsForOrientation:(UIInterfaceOrientation)orientation {

      if(orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
          _webview.frame=CGRectMake(0, 0, 770, 960);

      }

    else if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
        _webview.frame=CGRectMake(0, 0, 1030, 705);

    }
}
查看我的快照:

- (void) adjustViewsForOrientation:(UIInterfaceOrientation)orientation {

      if(orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
          _webview.frame=CGRectMake(0, 0, 770, 960);

      }

    else if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
        _webview.frame=CGRectMake(0, 0, 1030, 705);

    }
}
你可以看到在横向模式下有滚动,在纵向模式下还有很多空间

简而言之,我想增加UIWebView在纵向中的内容大小,减少UIWebView在横向中的内容大小,然后内容将根据屏幕大小进行调整,无需滚动


任何帮助都将不胜感激

您能为LandscapeMode找到解决方案吗?我在
肖像模式中增加了字体大小,在
LandscapeMode中减小了字体大小。建议:尝试不要在旋转时设置_webview.frame的大小——如果您正确设置了约束,webview应该自行调整大小。我发现,显式调整窗口大小通常会导致出现问题,最好让iOS尽可能多地处理这些问题。