将 button 设置背景图片,是可以的. 需要:
首先导入: #import <SDWebImage/UIButton+WebCache.h>
然后调用.

注意:
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state;
上述方法已经弃用.
如下图所示,调用方法:

将 button 设置背景图片,是可以的. 需要:
首先导入: #import <SDWebImage/UIButton+WebCache.h>
然后调用.
注意:
- (void)setBackgroundImageWithURL:(NSURL *)url forState:(UIControlState)state;
上述方法已经弃用.
如下图所示,调用方法:
本文标题: SDWebimage 的 UIButton 背景图片设置方法
本文链接:https://www.haomeiwen.com/subject/muzmkttx.html
网友评论