1 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ 2 UIView * view = [[UIView alloc]initWithFrame:CGRect ...
1 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ 2 UIView * view = [[UIView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)]; 3 view.backgroundColor = [UIColor orangeColor]; 4 view.alpha = 1; 5 [self.view addSubview:view]; 6 //动画持续时间为五秒 7 [UIView animateWithDuration:5 animations:^{ 8 view.alpha = 0; 9 }completion:^(BOOL finished) {//当动画结束后进行的操作10 //动画时间为一秒11 [UIView animateWithDuration:1 animations:^{12 view.alpha = 1;13 } completion:^(BOOL finished) {14 view.backgroundColor = [UIColor blueColor];15 }];16 }];17 }
原标题:iOS 简单动画 block动画
关键词:IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。