- (void)updateFollowButton {
if (!followButton.selected) {
[followButton setImage: [UIImage imageNamed:kFollowButtonImage] forState:UIControlStateNormal];
[followButton setImage:[UIImage imageNamed:kButtonFollowHighlighted] forState:UIControlStateHighlighted];
[followButton setBackgroundImage:[UIImage imageNamed:kFollowButtonImage] forState:UIControlStateDisabled];
} else {
[followButton setImage:[UIImage imageNamed:kUnfollowButtonImage] forState:UIControlStateNormal];
[followButton setImage:[UIImage imageNamed:kButtonfUnfollowHighlighted] forState:UIControlStateHighlighted];
[followButton setImage:[UIImage imageNamed:kUnfollowButtonImage] forState:UIControlStateDisabled];
}
}
当我设置选择状态时,我调用 updateFollowButton 来刷新按钮正常图像并突出显示图像。为什么这个简单的代码不起作用?
感谢您的回答。