我在我的项目中使用SDWeb Image,但我想知道是否有办法将图像设置为按钮的背景? SDWebImageManager *manager = [SDWebImageManager sharedManager];[manager downloadImageWithURL:imageURL options:0 progress:^(NSInteger r
SDWebImageManager *manager = [SDWebImageManager sharedManager]; [manager downloadImageWithURL:imageURL options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize) { // progression tracking code } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { if (image) { // do something with image [button setBackgroundImage:image forState:UIControlStateNormal]; } }];