gpt4 book ai didi

ios - Swift UIView.animateWithDuration 在加载内容时消失

转载 作者:行者123 更新时间:2023-11-30 13:45:30 25 4
gpt4 key购买 nike

我使用一个简单的动画来向下滑动一个小 View (该 View 包含一些标签和 imageView)。动画有效,但是当我尝试设置标签和 imageView 的内容时, View 消失。

有什么帮助吗?

UIView.animateWithDuration(1, delay: 0,
usingSpringWithDamping: springDamping,
initialSpringVelocity: velocity, options: option!, animations: {
self.sliderUserInfo.frame.origin = self.sliderUserInfoPosition
}, completion: {finished in
if finished {
self.loadContentView()
}
})

最佳答案

将代码修改为:

    var newFrame = self.sliderUserInfo.frame
newFrame.origin = self.sliderUserInfoPosition
UIView.animateWithDuration(1, delay: 0,
usingSpringWithDamping: springDamping,
initialSpringVelocity: velocity, options: option!, animations: {
self.sliderUserInfo.frame = newFrame
}, completion: {finished in
if finished {
self.loadContentView()
}
})

关于ios - Swift UIView.animateWithDuration 在加载内容时消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34986951/

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