How to gradually change (animation) the background color when selecting UITableViewCell

Asked 2 years ago, Updated 2 years ago, 143 views

UITableViewCell usually applies background color immediately when tapped.
As the background color changes gradually, I think UX can be improved.

However, when I searched online, there was a description of how to change the background color, but I couldn't find a way to animate it.
If you know how to do it, I would appreciate it if you could let me know.

ios uitableview

2022-09-30 21:14

1 Answers

UITableViewCell subclasses override

-(void)setSelected:(BOOL)selected animated:(BOOL)animated{

  [super setSelected:selected animated:YES];
}

- (void) setHighlighted: (BOOL) highlighted animated: (BOOL) animated {

  [super setHighlighted:highlighted animated:YES];
}


2022-09-30 21:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.