@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:@"abc.png"]]; [self.view addSubview:iv]; }
时间: 2024-11-10 07:27:42