gpt4 book ai didi

objective-c - UIView animateWithDuration : duration: animations: completion: seems to have a default transition?

转载 作者:技术小花猫 更新时间:2023-10-29 10:19:29 27 4
gpt4 key购买 nike

在我的程序中,我想创建一个以恒定速度移动的动画。看起来动画开始缓慢,加速然后缓慢结束。有什么办法可以改变吗?

最佳答案

您可以使用 animateWithDuration:delay:options:animations:completion: 选项更改此设置。为选项参数发送一个 UIViewAnimationOption 掩码。这些是您感兴趣的选项:

 UIViewAnimationOptionCurveEaseInOut 
UIViewAnimationOptionCurveEaseIn
UIViewAnimationOptionCurveEaseOut
UIViewAnimationOptionCurveLinear

文档说 UIViewAnimationOptionCurveEaseInOut 是默认值。

有关详细信息,请参阅文档:http://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html

关于objective-c - UIView animateWithDuration : duration: animations: completion: seems to have a default transition?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10794763/

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