cancel a UIView animateWithDuration before completion

后端 未结 3 1862
轮回少年
轮回少年 2021-02-12 16:30

I have this code in my project:

- (void) fadeImageView {
    [UIView animateWithDuration:1.0f
                          delay:0
                        options:         


        
3条回答
  •  南旧
    南旧 (楼主)
    2021-02-12 17:18

    From Apple docs: Use of this method is discouraged in iOS 4.0 and later. Instead, you should use the animateWithDuration:delay:options:animations:completion: method to specify your animations and the animation options.:

    [UIView animateWithDuration:1.f
                          delay:0
                        options:UIViewAnimationOptionBeginFromCurrentState
                     animations:^{
                         self.imageView.alpha = 0.0f;
    } completion:NULL];
    

提交回复
热议问题