我正在构建一个 Xamarin Android 应用程序,我有一个 LatLng 位置列表,我想每秒移动我的标记,在我的列表的每个位置...
您知道如何实现吗?谢谢
最佳答案
首先创建一个定时器=>
timer = new Timer();
timer.Interval = 200;
timer.Enabled = true;
timer.Elapsed += OnMarkerMoving;
timer.Start();
然后在您的 OnMarkerMoving 方法中 =>
public void OnMarkerMoving()
{
count++
if(count < positionList.Count)
{
yourMarker.Position = positionList[count];
} else
timer.Dispose();
}
关于android - 如何让我的标记每秒移动一次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43680465/