几种cell动画

这篇博客介绍了如何在UITableView中为单元格(cell)添加动画效果。在`willDisplayCell`方法中,通过设置cell的layer属性,包括阴影颜色、偏移、透明度和缩放变换,实现了两种不同的动画效果:一种是渐显并平滑调整阴影和尺寸;另一种是通过改变高度和位置,配合alpha值变化,实现淡入和高度变化的动画。这些动画为表格视图增添了视觉吸引力。
摘要由CSDN通过智能技术生成

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

    if (indexPath.row == 1 && indexPath.section <2) {

        cell.layer.shadowColor = [[UIColor blackColor] CGColor];

        cell.layer.shadowOffset = CGSizeMake(10, 10);

        cell.alpha = 0;

        cell.layer.transform = CATransform3DMakeScale(0.5, -0.15, 1);

        cell.layer.anchorPoint = CGPointMake(0.5, -0.5);

        

        // define final state (e.g. after animation) & commit animation

        [UIView beginAnimations:@"scaleTableViewCellAnimationID" context:NULL];

        [UIView setAnimationDuration:1];

        cell.layer.shadowOffset = CGSizeMake(0, 0);

        cell.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值