助けてください。UIWebView に PDF があります。右側に移動して、境界線と一部のコンテンツが切り取られます。デバイスを横向きにしてから、webview/pdf を含むページを開くと、これが発生します。これは、デバイスとシミュレーターで発生します。コードはこちら。
#import "waterTwoViewController.h"
@interface waterTwoViewController ()
@end
@implementation waterTwoViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
double screenWidth = [UIScreen mainScreen].bounds.size.width;
double screenHeight = [UIScreen mainScreen].bounds.size.height;
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, screenWidth,
screenHeight)];
webView.scalesPageToFit=YES;
webView.contentMode = UIViewContentModeScaleToFill;
webView.multipleTouchEnabled = YES;
webView.autoresizingMask = UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight;
[self.view addSubview:webView];
NSString *path = [[NSBundle mainBundle] pathForResource:@"WaterLineSizingValues"
ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[webView loadRequest:request];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end