UIWebView显示gif类型图片

 NSData *gifFile = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"text" ofType:@"gif"]];
    _mywebview.scalesPageToFit = YES;
    [_mywebview loadData:gifFile MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];

  html

      NSString *html = @"<html><head><body><img src="text.gif"><body></head></html>";
    NSString *path = [[NSBundle mainBundle] resourcePath];
    NSURL *baseURL = [NSURL fileURLWithPath:path];
    //_mywebview.scrollView.bounces = NO;
    _mywebview.scalesPageToFit = YES;
    //_mywebview.scrollView.scrollEnabled = NO;
    [_mywebview loadHTMLString:html baseURL:baseURL];
原文地址:https://www.cnblogs.com/KingQiangzi/p/3796803.html