草庐IT

setBackgroundImageWithURL

全部标签

ios - 使用 SDWebimage 在 UIButton 中设置背景图像

我想使用SDWebImage设置UIButton背景图像。代码:-[btn.imageViewsetImageWithURL:[NSURLURLWithString:@"imageurlhere"]placeholderImage:[UIImageimageNamed:@"placeholder"]];谢谢 最佳答案 在SDWebImage中有这样的方法:SDWebImage/SDWebImage/UIButton+WebCache.h在您的类(class)中导入此文件:#import使用以下任一方法:-(void)sd_setBa

ios - 使用 SDWebimage 在 UIButton 中设置背景图像

我想使用SDWebImage设置UIButton背景图像。代码:-[btn.imageViewsetImageWithURL:[NSURLURLWithString:@"imageurlhere"]placeholderImage:[UIImageimageNamed:@"placeholder"]];谢谢 最佳答案 在SDWebImage中有这样的方法:SDWebImage/SDWebImage/UIButton+WebCache.h在您的类(class)中导入此文件:#import使用以下任一方法:-(void)sd_setBa