我是iPad开发新手,
我制作了epub阅读器,并在我的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);
}
}
查看我的快照:
您可以看到在横向模式下滚动,并且在纵向模式下有很多空格。
简而言之,我希望以纵向增加UIWebView的内容大小,并在横向上减少UIWebView的内容大小,然后内容将根据屏幕大小而不适合滚动。< / p>
我们将不胜感激任何帮助!