一个点击cell的动画效果 发表于 2018-02-23 17:34 | 更新于 2019-06-12 15:55 | 分类于 iOS开发小技巧 | 阅读次数 字数统计 120 字 今天给大家介绍一个关于cell的比较炫酷的点击动画效果,具体效果请看下面 代码如下: 12345678910111213141516//点击状态-(void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.2]; cell.transform = CGAffineTransformMakeScale(0.87, 0.87);//cell进行缩放 [UIView commitAnimations];}//复原-(void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.2]; cell.transform = CGAffineTransformMakeScale(1, 1); [UIView commitAnimations];}