gpt4 book ai didi

ios - animateWithDuration 不能淡入淡出

转载 作者:行者123 更新时间:2023-11-28 22:26:36 31 4
gpt4 key购买 nike

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

    [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;
}];
}];

这也不行。

我该如何解决这个问题?

最佳答案

如果你想在第一个完成后将它们组合起来开始第二个,请使用:

[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;
}];
}];

关于ios - animateWithDuration 不能淡入淡出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18781118/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com