iOS 4.3 でのみ発生するこのバグを修正する方法を見つけようとしています。アプリケーションが起動すると、UIWebView に収まるようにスケーリングされた PDF が表示されます。ドキュメントをピンチしてズームし、回転させて黒い領域を残すまでは、完全に動作します。ピンチしてズームしないと、黒い領域から離れません。これが iOS 4.3 のみの問題である理由がわかりません。問題のスクリーンショット: この問題の解決にしばらく取り組んできましたが、ご協力をお願いいたします。ありがとうございました。
.xib 設定のスクリーンショット:
私が使用しているコードは次のとおりです。
.h:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
UIWebView *webView;
}
@property (nonatomic) IBOutlet UIWebView *webView;
@end
.m:
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize webView;
- (BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
} else {
return (interfaceOrientation !=
UIInterfaceOrientationPortraitUpsideDown);
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"pdf"];
NSURL *url = [NSURL fileURLWithPath:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
@end