ios 在使用 SDWebimage UIButton setBackgroundimage

 

 

解决方法 :

有法为此在 SDWebImage: SDWebImage / SDWebImage / UIButton+WebCache.h

导入此文件在您的类:

#import <SDWebImage/UIButton+WebCache.h>

使用此方法的任何一种:

 - (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state;
 - (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder;
 - (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options;
 - (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state completed:(SDWebImageCompletedBlock)completedBlock;
 - (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder completed:(SDWebImageCompletedBlock)completedBlock;
 - (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options completed:(SDWebImageCompletedBlock)completedBlock;
 
 
 
 
原文地址:https://www.cnblogs.com/-yun/p/7467400.html