gpt4 book ai didi

iphone - iOS如何一直保持当前位置中心

转载 作者:可可西里 更新时间:2023-11-01 04:28:06 26 4
gpt4 key购买 nike

我的 map 用蓝点显示当前位置..当然,当我移动时,蓝点也会移动。我只是想一直保持 map 的蓝点中心,让 map 像 Google map 导航器一样移动。

找了很多都找不到路...

最佳答案

在您的 map View 委托(delegate)中,执行此操作:

- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
[mapView setCenterCoordinate:userLocation.location.coordinate animated:YES];
}

关于iphone - iOS如何一直保持当前位置中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7461553/

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