gpt4 book ai didi

ios - UILabel IOS Swift 中的动画值

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

我想在 UILabel 中用动画重复显示值 1-10,用户应该能够慢慢看到值的波动,我如何实现此功能?

最佳答案

您可以使用:

var timer : NSTimer = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: "change_label", userInfo: nil, repeats: true)


func change_label()

{

count = count+1
label.text = String(format: "%d",count)

}

关于ios - UILabel IOS Swift 中的动画值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35030948/

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