1~
NSString *path=[[NSBundle mainBundle]pathForResource:@"Navbar7" ofType:@"png"];
UIImage *img=[UIImage imageWithContentsOfFile:path];
[nav2.navigationBar setBackgroundImage:img forBarMetrics:UIBarMetricsDefault];
2~设置默认图
[self.HeadImageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"user.jpg"]];
3~
NSURL *imageurl =[NSURL URLWithString:[NSString stringWithFormat:@"%@",[dicdoctor valueForKey:@"doctor_photo"]]] ;
[ImageHead setImageWithURL:imageurl placeholderImage:[UIImage imageNamed:@"doctor.jpg"]];
//ImageHead是一个UIImageView
4~
NSURL *url = [NSURL URLWithString: @"http://www.baidu.com/img/baidu_sylogo1.gif"];
UIImage *imagea = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]];
5~Button 从网络加载背景图
#import "UIButton+WebCache.h"
[self.cellBtn1 setBackgroundImageWithURL:imageUrl1 forState:UIControlStateNormal];