有没有办法在MKAnnotationView
的图像中注册tapgesture?
基本上我的注释 View 看起来像这样,它没有标题,没有副标题,只有自定义图像,如果可能的话我想保持这种状态:
My current test MKAnnotationView
我想在图像内点击时导航到不同的 View Controller 或从屏幕底部显示 TableView。现在我真的只需要了解如何在内部注册点击手势,以便我可以继续使用该功能。
干杯。
最佳答案
您可以使用didSelect
方法。
例如
func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
// navigate to a different viewcontroller
// or show a TableView from the bottom of the screen
}
关于ios - 如何在 MKAnnotationView 图像上注册 Tapgesture?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52401821/