gpt4 book ai didi

ios - UIView animatewithduration-iOS

转载 作者:行者123 更新时间:2023-12-01 17:43:25 26 4
gpt4 key购买 nike

我正在尝试使用UIView animateWithDuration将标签从A点移动到B点,如下所示

    [UIView animateWithDuration:3 delay:0 options:UIViewAnimationTransitionNone animations:^(void){
label.alpha = 1;
label.center = CGPointMake(label.center.x , label.center.y +740);

}completion:^(BOOL Finished){
label.alpha = 0;
label.center = CGPointMake(label.center.x , label.center.y - 740);]

一旦标签即将达到740,它就会减速。是否有可能使匀速运动到B点而不是放慢速度?

最佳答案

用这个:

[UIView animateWithDuration:3 delay:0 options:UIViewAnimationTransitionNone | UIViewAnimationOptionCurveLinear animations:^(void){ 
...

关于ios - UIView animatewithduration-iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12879802/

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