我是初学者,有一样东西是看不懂的。 在这个example存在信息按钮。据我了解,有一段代码返回此按钮:
func mapView(_ mapView: MGLMapView, rightCalloutAccessoryViewFor annotation: MGLAnnotation) -> UIView? {
return UIButton(type: .detailDisclosure)
}
所以问题是:如何以编程方式从此按钮打开另一个 View ( View 名称:extraInfo, View Controller 的名称:extraInfoController)? 拜托,你能详细回复吗,因为我已经很伤心了,我是初学者。 :) (我使用的是 Swift,不是 Obj-C)
最佳答案
你可以使用这个委托(delegate)方法
func mapView(_ mapView: MGLMapView, annotation: MGLAnnotation, calloutAccessoryControlTapped control: UIControl) {
}
关于ios - UIButton、Mapbox、以编程方式打开新 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43300384/