用UIWebView加载本地gif,png的试了不行,其他格式的没有试。

可以显示动态的图片

代码很简单如下:

    NSString *html = @"<html><head><body><img src=\"diablo.gif\"><body></head></html>";
    NSString *path = [[NSBundle mainBundle] resourcePath];
    NSURL *baseURL = [NSURL fileURLWithPath:path];
    [webImage loadHTMLString:html baseURL:baseURL];

把其中的diablo.gif换成你想加载的gif图片就可以了,webImage是UIWebView的对象。

 
 

相关文章:

  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-11-01
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2021-12-17
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案