gpt4 book ai didi

Change Region prevents user interaction with the map(更改区域阻止用户与地图进行交互)

转载 作者:bug小助手 更新时间:2023-10-25 18:09:34 29 4
gpt4 key购买 nike



I use MapKit and I use the code below to change the region:

我使用MapKit,并使用以下代码更改区域:


mapView.setRegion(region, animated: true)

The problem is while changing the region it prevents user interaction with the map.
How can we cancel or stop the "setRegion" when the user engages with the map?

问题是,在更改区域时,它会阻止用户与地图进行交互。当用户使用地图时,我们如何取消或停止“setRegion”?


I expect The map stops changing regions when the user tries to touch it.

我希望当用户尝试触摸地图时,地图会停止更改区域。


更多回答
优秀答案推荐

I didn't use mapkit, but I believe you can stop with the following code:

我没有使用mapkit,但我相信您可以通过以下代码停止:


extension MKMapView {
func stopRegionChangeAnimation() {
self.setRegion(self.region, animated: false)
}
}

更多回答

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