1
UIWebView가 있고 로컬 파일을로드합니다. 문서가 핀치 확대/축소 및 setFrame UIWebView에서 그리기 문제가 발생합니다.
- 나는 핀치 제스처를
- 을하고 그 후 내가있는 UIWebView에 대한 더 큰 폭을 설정합니다. 는
결과 : 이 검은 색 굵은 줄무늬가있는 UIWebView의 오른쪽에 나타납니다됩니다.
이 문제를 어떻게 해결할 수 있는지 알고 계십니까?
미리 도움 주셔서 감사합니다.
@interface ViewController() {
__weak IBOutlet UIWebView *webView;
CGRect initialFrame;
}
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
initialFrame = webView.frame;
webView.scalesPageToFit = YES;
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"chapter7" ofType:@"ppt"]]]];
}
static int c = 1;
- (IBAction)buttonPressed:(id)sender {
c++;
if (c % 2 == 0)
{
//full screen
CGRect frame = initialFrame;
frame.origin.x -= 100;
frame.size.width += 100;
[webView setFrame:frame];
}
else
{
//initial
[webView setFrame:initialFrame];
}
}