0

我想在我的标签上执行淡出然后淡入,我可以让两者分开工作,但不能一起工作。

    [UILabel animateWithDuration:1.0 animations:^{
        _swixValla.alpha = 0.0;
        _skigoValla.alpha = 0.0;
        _rodeValla.alpha = 0.0;
        _startValla.alpha = 0.0;
    }];


    [UILabel animateWithDuration:1.0 animations:^{
        _swixValla.alpha = 1.0;
        _skigoValla.alpha = 1.0;
        _rodeValla.alpha = 1.0;
        _startValla.alpha = 1.0;
    }];

这不起作用

    [UILabel animateWithDuration:1.0 animations:^{
        _swixValla.alpha = 0.0;
        _skigoValla.alpha = 0.0;
        _rodeValla.alpha = 0.0;
        _startValla.alpha = 0.0;


    [UILabel animateWithDuration:1.0 animations:^{
        _swixValla.alpha = 1.0;
        _skigoValla.alpha = 1.0;
        _rodeValla.alpha = 1.0;
        _startValla.alpha = 1.0;
    }];
    }];

这也不起作用。

我该如何解决这个问题?

4

1 回答 1

2

如果您想在第一个完成后将它们组合起来以启动第二个,请使用:

[UIView animateWithDuration:1.0 animations:^{
    _swixValla.alpha = 0.0;
    _skigoValla.alpha = 0.0;
    _rodeValla.alpha = 0.0;
    _startValla.alpha = 0.0;
}completion:^(BOOL finished){
    [UILabel animateWithDuration:1.0 animations:^{
        _swixValla.alpha = 1.0;
        _skigoValla.alpha = 1.0;
        _rodeValla.alpha = 1.0;
        _startValla.alpha = 1.0;
    }];
}];
于 2013-09-13T07:59:18.997 回答