UIWebView显示gif类型图片

时间:2014-06-20 16:16:58   收藏:0   阅读:226
 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];

 

UIWebView显示gif类型图片,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!