• www8222.com,www8222.com【唯一授权官网】

  • 发布时间:2016-01-13 10:13 | 作者:yc | 来源:互联网 | 浏览:1200 次
  • www8222.com,www8222.com【唯一授权官网】

    将VIew移动做成动画感化这种动画感化没有中间的位移

    能够增添动画的View特征center,frame,alpha,transform , backgroundColor

    //持续做不见的动画

    [UIView animateWithDuration:1 animations:^{

    蓝懿教育九月二十七日记录

    iv.alpha = 0;

    } completion:^(BOOL finished) {

    //完结动画后实行 能够持续增添

    [iv removeFromSuperview];

    }];

    - (void)viewDidLoad {

    [super viewDidLoad];

    // Do any

    additional setup after loading the view, typically from a nib.

    [NSTimer scheduledT博彩评级imerWithTimeInterval:0.1 target:self selector:@selector(addSnow) userInfo:nil repeats:YES];

    }

    -(void)addSnow{

    int size = arc4random()%10+10;

    UIImageView *iv = [[UIImageViewalloc]initWithFrame:CGRectMake(arc4random()%(320-size), -size, size, size)];

    iv.image = [UIImageimageNamed:@"snow"];

    [self.view addSubview:iv];

    int time = arc4random()%4+1;

    //增添移动动画

    [UIView animateWithDuration:time animatimg电子游艺注册送白菜ons:^{

    //移动的结尾方位

    iv.center = CGPointMake(iv.center.x, 568);

    //图形篡改结尾外形

    iv.transform = CGAffineTransformRotate(iv.transform, (arc4random()%360)/180.0*M_PI);

    } completion:^(BOOLfinished) {

    //持续做雪花不见的动画

    [UIView animateWithDuration:1 animations:^{

    iv.alpha = 0;

    } completion:^(BOOL finished) {

    蓝懿教育九月二十七日记录[iv removeFromSuperview];

    }];

    }];

    }

  • 相关内容

友情链接: