• IOS UIView 放大缩小


    /创建缩小了的视图
    myWeiBoImageVC = [[UIViewController alloc] init];
    myWeiBoImageVC.view.clipsToBounds = YES;
    myWeiBoImageVC.view.alpha = 0.0;
    myWeiBoImageVC.view.frame = CGRectMake(64, 0, 1024-64, 768-20);
    [self.view addSubview:myWeiBoImageVC.view];
        
    CGAffineTransform newTransform = 
    CGAffineTransformScale(myWeiBoImageVC.view.transform, 0.1, 0.1);
    [myWeiBoImageVC.view setTransform:newTransform];
    myWeiBoImageVC.view.center = CGPointMake(670, 100);
     
    [self performSelector:@selector(imageViewControllerBigAnimation)];

    //放大刚刚创建缩小后的视图
    - (void)imageViewControllerBigAnimation{
       
        [UIView beginAnimations:@"imageViewBig" context:nil];
        [UIView setAnimationDuration:0.5];   
        CGAffineTransform newTransform =            CGAffineTransformConcat(myWeiBoImageVC.view.transform,  CGAffineTransformInvert(myWeiBoImageVC.view.transform));
        [myWeiBoImageVC.view setTransform:newTransform];
        myWeiBoImageVC.view.alpha = 1.0;
        myWeiBoImageVC.view.center = CGPointMake(416, 510);
        [UIView commitAnimations];
       
    }

    //缩小视图 隐藏

    - (void)imageViewControllerSmallAnimation{

        [UIView beginAnimations:@"imageViewSmall" context:nil];
        [UIView setAnimationDuration:0.5];
        CGAffineTransform newTransform =  CGAffineTransformScale(myWeiBoImageVC.view.transform, 0.1, 0.1);
        [myWeiBoImageVC.view setTransform:newTransform];
        myWeiBoImageVC.view.center = CGPointMake(670, 100);
        [UIView commitAnimations];
       
    }

  • 相关阅读:
    java List转换为字符串并加入分隔符的一些方法总结
    jackson 实体转json 为NULL或者为空不参加序列化
    马云告别演讲
    Linux chmod命令
    Linux执行shell脚本的方法
    2019第36周日
    2019第36周六
    eclipse中的maven插件
    SpringBoot要点之使用Actuator监控
    eclipse隐藏的列编辑
  • 原文地址:https://www.cnblogs.com/geek6/p/3947998.html
Copyright © 2020-2023  润新知