2012-11-05 1 views
1

UIWebView가 있고 로컬 파일을로드합니다. 문서가 핀치 확대/축소 및 setFrame UIWebView에서 그리기 문제가 발생합니다.

  • 을로드

    1. 나는 핀치 제스처를
    2. 을하고 그 후 내가있는 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]; 
        } 
    } 
    
  • 답변

    0

    있는 UIWebView는 그것뿐만 아니라 증가 된 공간에서 렌더링하는 프레임 크기 순서대로 변경 될 때 다시로드가 : 여기

    몇 가지 샘플 코드입니다.