0

アイテムのアルファ値を高い値から低い値に変更して 3 秒ごとに「発光」させようとしています。ただし、「ちらつき」、基本的に 0.2 秒ごとに色がランダムに変化します。以下に方法を貼り付けました。おそらく完了が呼び出されたときに何か関係がありますが、わかりませんか?

-(void)showLoading{
    [self.postTableView setHidden:YES];
    self.isLoading = true;
    //Disappear
    [UIView animateWithDuration:1.5 animations:^(void) {
        self.loadingLabel.alpha = 0.8;
        self.loadingLabel.alpha = 0.3;
    }
    completion:^(BOOL finished){
            //Appear
            [UIView animateWithDuration:1.5 animations:^(void) {
            self.loadingLabel.alpha = 0.3;
            self.loadingLabel.alpha = 0.8;
            }completion:^(BOOL finished2){
                if(true){
                    [self showLoading];
                }
            }];
    }]; }
4

2 に答える 2

-2
-(void)viewDidLoad{
//use schedule timer to call repeatedly showLoading method until loading done
}
-(void)showLoading{
    [self.postTableView setHidden:YES];
    self.isLoading = true;
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.5];

    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
    self.loadingLabel.alpha = 0.3;
    [UIView commitAnimations];


    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.5];

    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
    self.loadingLabel.alpha = 0.8;
    [UIView commitAnimations];
}
于 2015-03-28T03:29:17.200 に答える