UIWebView动态展示gif gif图不适应控件大小

CGRect frame = CGRectMake(0,[[UIApplication sharedApplication] statusBarFrame].size.height+44,350,350);
    // view生成
    UIWebView *webView = [[UIWebView alloc] initWithFrame:frame];
    webView.backgroundColor = [UIColor redColor];
    webView.userInteractionEnabled = NO;//用户不可交互
    NSURL *url = [NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"NeuRecord.bundle/1" ofType:@"gif"]];
    [webView loadRequest:[NSURLRequest requestWithURL:url]];
    [webView setScalesPageToFit:YES];//自动适应当前frame大小
    [self.view addSubview:webView];

你可能感兴趣的:(UIWebView动态展示gif gif图不适应控件大小)