码迷,mamicode.com
首页 > 移动开发 > 详细

IOS UIView 放大缩小

时间:2014-08-31 19:55:21      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:os   io   for   sp   on   new   c   ad   ios   

/创建缩小了的视图
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];
   
}

IOS UIView 放大缩小

标签:os   io   for   sp   on   new   c   ad   ios   

原文地址:http://www.cnblogs.com/geek6/p/3947998.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!