zoukankan      html  css  js  c++  java
  • tableView cell 的点击放大效果

    之前在其它博客上看到Cell的点击放大效果代码都比较繁复,效果也不是很好.自己写了一个demo 主要代码附带如下

    1. TGHomeADTCell 是自定义的cell 子视图就是一个imageView 其中最主要的代码就是下面这句

     [cell snapshotViewAfterScreenUpdates:NO], 其实操作的就是这个截图生成的视图. 动画执行的时间和放大效果可以自己设置.

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

       TGHomeADTCell *cell = [self.homeTable cellForRowAtIndexPath:indexPath];

        UIView *tempMoveCell = [cell snapshotViewAfterScreenUpdates:NO];

        tempMoveCell.frame = cell.frame;

        [self.homeTable addSubview:tempMoveCell];

        [UIView animateWithDuration:0.01 animations:^{

            tempMoveCell.transform = CGAffineTransformMakeScale(1.05, 1.05);

        } completion:^(BOOL finished) {

            [UIView animateWithDuration:0.01 animations:^{

                tempMoveCell.transform = CGAffineTransformIdentity;

            } completion:^(BOOL finished) {

                [tempMoveCell removeFromSuperview];

                [self.navigationController pushViewController:controller animated:YES];

            }];

        }];

    }

  • 相关阅读:
    Session的异常
    struts2中把action中的值传递到jsp页面的例子
    struts2中怎么把action中的值传递到jsp页面
    struts2理解
    Struts2工作原理
    第十五章 String讲解
    十六进制转十进制
    数据库综合系列 之 触发器
    android PopupWindow实现从底部弹出或滑出选择菜单或窗口
    kettle内存溢出
  • 原文地址:https://www.cnblogs.com/relly0121/p/6879857.html
Copyright © 2011-2022 走看看