// 设定位置和大小
CGRect frame = CGRectMake(50,50,0,0);
frame.size = [UIImage imageNamed:@"anim.gif"].size;
CGRect frame = CGRectMake(50,50,0,0);
frame.size = [UIImage imageNamed:@"anim.gif"].size;
// 读取gif图片数据
NSData *gif = [NSData dataWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"anim" ofType:@"gif"]];
NSData *gif = [NSData dataWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"anim" ofType:@"gif"]];
// view生成
UIWebView *view = [[UIWebView alloc] initWithFrame:frame];
[view loadData:gif MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];
UIWebView *view = [[UIWebView alloc] initWithFrame:frame];
[view loadData:gif MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];
[WebView setOpaque:NO];
[WebView setBackgroundColor:[UIColor clearColor]];
Nav.topItem.title=@"Welcome";
Nav.topItem.leftBarButtonItem=nil;
NSString* gifFileName = @"j_0002.gif";
NSMutableString* htmlStr = [NSMutableString string];
[htmlStr appendString:@"Hello Honey"];
[htmlStr appendString:@"<p><img src=\""];
[htmlStr appendFormat:@"%@",gifFileName];
[htmlStr appendString:@"\" alt=\"picture\"/>"];
[WebView loadHTMLString:htmlStr baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];