Skip to content

Commit

Permalink
fix: NVImageView will flash during reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonXi committed Feb 26, 2018
1 parent 0b32909 commit acad9e8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions VirtualView/Node/Widget/NVImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#import "NVImageView.h"
#import "UIColor+VirtualView.h"
#import "VVPropertyExpressionSetter.h"
#import <SDWebImage/UIImageView+WebCache.h>

#ifdef VV_ALIBABA
Expand Down Expand Up @@ -142,6 +143,16 @@ - (void)setScaleType:(VVScaleType)scaleType
}
}

- (void)setSrc:(NSString *)src
{
if ([_src isEqualToString:src] == NO) {
_src = src;
self.imageView.image = nil;
[self.imageView sd_setImageWithURL:nil];
self.needReload = YES;
}
}

#ifdef VV_ALIBABA
- (void)updateSrc
{
Expand Down Expand Up @@ -220,13 +231,6 @@ - (BOOL)setStringValue:(NSString *)value forKey:(int)key
return ret;
}

- (void)reset
{
self.imageView.image = nil;
[self.imageView sd_setImageWithURL:nil];
self.needReload = YES;
}

- (void)setupLayoutAndResizeObserver
{
[super setupLayoutAndResizeObserver];
Expand Down

0 comments on commit acad9e8

Please sign in to comment.