iOS: optimze when updating cell do not cause size change, do not reload

This commit is contained in:
pengfei.zhou
2021-10-20 17:49:46 +08:00
committed by osborn
parent c04994ab21
commit 72a4562885
4 changed files with 35 additions and 0 deletions

View File

@@ -63,6 +63,11 @@ - (instancetype)init {
return self;
}
- (void)setText:(NSString *)text {
[super setText:text];
self.placeholderLabel.hidden = self.text.length > 0;
}
- (void)layoutSubviews {
[super layoutSubviews];
self.placeholderLabel.hidden = self.text.length > 0;