【发布时间】:2021-08-06 03:41:05
【问题描述】:
正如标题所说,我怎样才能让 LocalTime.now 不断更新,基本上变成了一个时钟?
var current = LocalTime.now()
Current.text = current.toString()
//Current is the textView id in xml
// this currently prints out what the local time is at app launch.
【问题讨论】:
-
您必须定期更新它,从这个意义上说,没有“连续函数”之类的东西。所以也许考虑运行重复的、延迟的代码并从那里开始。