Удаление и удаление объекта, используемого в анимации, не будет - PullRequest
0 голосов
/ 01 декабря 2019

Использование Obj-c для непрерывной анимации альфы, но когда я пытаюсь обнулить наше и удалить подпредставление, оно останавливается и не удаляет и не прекращает анимацию?

-(void)flashFingerPrint{
    [UIView animateKeyframesWithDuration:1 delay:0 options:UIViewAnimationOptionRepeat|UIViewAnimationOptionAutoreverse|UIViewAnimationCurveEaseInOut animations:^{
         self.purpleFingerPrint.alpha = 0;
    } completion:^(BOOL finished) {
        nil;
    }];
}



-(void)hidePurpleHelper {

    if(nil != self.purpleFingerPrint && nil != self.purpleFingerPrint) {

        // add it to the screen with animation
        [UIView animateWithDuration:0.5 delay:0.2 options:(UIViewAnimationCurveEaseOut) animations:^{
            self.purpleHelperView.alpha = 0;
            self.purpleFingerPrint.alpha = 0;
            self.purpleFingerPrint = nil;
            [self.view willRemoveSubview:self.purpleFingerPrint];

        } completion:^(BOOL finished) {
            // nothing
            self.purpleHelperView = nil;
            self.purpleFingerPrint = nil;
            [self.view willRemoveSubview:self.purpleFingerPrint];
        }];
    }
}

Я вызываю функцию скрытия, ноотпечаток пальца все еще отображается на экране и продолжает мигать?

1 Ответ

2 голосов
/ 01 декабря 2019

Вам нужно

[self.purpleFingerPrint removeFromSuperview];
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...