您可以使用 Xamarin 文档中记录的 System.Threading.Timer 类:https : //developer.xamarin.com/api/type/System.Threading.Timer/
或者,对于 Xamarin.Forms,您可以通过 Device 类访问跨平台 Timer:
Device.StartTimer(TimeSpan.FromSeconds(1), () =>
{
// called every 1 second
// do stuff here
return true; // return true to repeat counting, false to stop timer
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16509 次 |
| 最近记录: |