解决方案 »

  1.   

    主要是移动动画,可以将元素在初始化时先放到屏幕外,也就是坐标不在(x:320,y:480)内。使用CABasicAnimation 创建多个移动动画。再使用CAAnimationGroup 来管理这些动画。 伪代码如下////////bounds animation
    CABasicAnimation *boundsAnimation =
    [CABasicAnimation animationWithKeyPath:@”bounds”];
    [boundsAnimation setToValue:[NSValue valueWithRect:newRect]];
    [boundsAnimation setDuration:15.0f];
    [boundsAnimation setBeginTime:0.0f];
    ///////position animation
    CABasicAnimation *positionAnimation =
    [CABasicAnimation animationWithKeyPath:@”position”];
    [positionAnimation setToValue:[NSValue valueWithPoint:NSMakePoint(0.0, 0.0)]];
    [positionAnimation setDuration:15.0f];
    [positionAnimation setBeginTime:5.0f];
    /////////border width animation
    CABasicAnimation *borderWidthAnimation =
    [CABasicAnimation animationWithKeyPath:@”borderWidth”];
    [borderWidthAnimation setToValue:[NSNumber numberWithFloat:30.0f]];
    [borderWidthAnimation setDuration:15.0f];
    [borderWidthAnimation setBeginTime:10.0f];
    ///////////动画组
    CAAnimationGroup *group = [CAAnimationGroup animation];
    [group setDuration:15];
    [group setAnimations:
    [NSArray arrayWithObjects:boundsAnimation, positionAnimation,
    borderWidthAnimation, nil]];
    [layer addAnimation:group forKey:nil];
      

  2.   

    在 viewWillAppear里, 
    把 imageView.frame = 屏幕外的frame, 在 viewDidAppear 里, [UIView animateWithDuration: 0.3f
    animations: ^{
         imageView.frame = 该显示的frame; 

    completion: (BOOL finished){}];