修改首页pop对钩问题
This commit is contained in:
@@ -59,6 +59,7 @@
|
||||
self.downloadLabel.text = character.download ?: @"";
|
||||
self.descLabel.text = character.characterBackground ?: @"";
|
||||
[self.avatarView kb_setImageURL:character.avatarUrl placeholder:KBAvatarPlaceholderImage];
|
||||
[self kb_updateSaveButtonWithAdded:character.added];
|
||||
}
|
||||
|
||||
#pragma mark - Build UI
|
||||
@@ -138,6 +139,24 @@
|
||||
if (self.closeHandler) self.closeHandler();
|
||||
}
|
||||
|
||||
#pragma mark - UI State
|
||||
|
||||
- (void)kb_updateSaveButtonWithAdded:(BOOL)added {
|
||||
if (added) {
|
||||
self.saveButton.enabled = NO;
|
||||
self.saveButton.backgroundColor = [UIColor colorWithWhite:0.93 alpha:1.0];
|
||||
[self.saveButton setTitle:@"✓" forState:UIControlStateNormal];
|
||||
[self.saveButton setTitle:@"✓" forState:UIControlStateDisabled];
|
||||
[self.saveButton setTitleColor:[UIColor colorWithWhite:0.55 alpha:1.0] forState:UIControlStateNormal];
|
||||
[self.saveButton setTitleColor:[UIColor colorWithWhite:0.55 alpha:1.0] forState:UIControlStateDisabled];
|
||||
} else {
|
||||
self.saveButton.enabled = YES;
|
||||
self.saveButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0];
|
||||
[self.saveButton setTitle:@"Save" forState:UIControlStateNormal];
|
||||
[self.saveButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Helpers
|
||||
|
||||
- (UIImage *)placeholderAvatar {
|
||||
@@ -246,4 +265,3 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user