[第三方]SDWebImage获取网络图片控件的用法
#import "UIImageView+WebCache.h" @interface WeatherViewController ()<UISearchBarDelegate> @end @implementation WeatherViewController - (void)viewDidLoad { [super viewDidLoad]; UIImageView* iv=[[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds]; NSURL* imgURL=[NSURL URLWithString:@"http://img4.duitang.com/uploads/item/201401/13/20140113225430_ihnyJ.thumb.600_0.jpeg"]; [iv sd_setImageWithURL:imgURL]; //带placeholder的方法 [iv sd_setImageWithURL:imgURL placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; [self.view addSubview:iv]; }
“人生苦短,不要把时间浪费在犹豫不决上,喜欢的东西就去买,喜欢的人就去追。”