修改UI
This commit is contained in:
@@ -15,6 +15,12 @@ static inline SDWebImageOptions KBWebImageDefaultOptions(void) {
|
||||
SDWebImageProgressiveLoad; // 渐进式
|
||||
}
|
||||
|
||||
static inline void KBWebImageEnsureIndicator(UIImageView *imageView) {
|
||||
if (!imageView.sd_imageIndicator) {
|
||||
imageView.sd_imageIndicator = SDWebImageActivityIndicator.mediumIndicator;
|
||||
}
|
||||
}
|
||||
|
||||
static inline NSURL *_KBURL(id url) {
|
||||
if (!url) return nil;
|
||||
if ([url isKindOfClass:NSURL.class]) return url;
|
||||
@@ -32,6 +38,7 @@ static inline NSURL *_KBURL(id url) {
|
||||
NSURL *u = _KBURL(url);
|
||||
// 默认渐隐动画
|
||||
__weak typeof(self) weakSelf = self;
|
||||
KBWebImageEnsureIndicator(self);
|
||||
[self sd_setImageWithURL:u
|
||||
placeholderImage:placeholder
|
||||
options:options
|
||||
@@ -66,6 +73,7 @@ static inline NSURL *_KBURL(id url) {
|
||||
}
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
KBWebImageEnsureIndicator(self);
|
||||
[self sd_setImageWithURL:u
|
||||
placeholderImage:placeholder
|
||||
options:options
|
||||
@@ -106,6 +114,7 @@ static inline NSURL *_KBURL(id url) {
|
||||
NSDictionary *context = @{ SDWebImageContextImageTransformer : pipeline };
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
KBWebImageEnsureIndicator(self);
|
||||
[self sd_setImageWithURL:u
|
||||
placeholderImage:placeholder
|
||||
options:options
|
||||
|
||||
Reference in New Issue
Block a user