0
マップキットからデフォルトのコールアウトビューを無効にする必要があります。カスタマイズされたコールアウトビューを使用しています。ピンアイコンをクリックすると両方のビューが表示されます。mapkitからのデフォルトのコールアウトビューを無効にするにはどうすればいいですか?
func mapView(mapView: MKMapView, didSelectAnnotationView view: MKAnnotationView){
let customView = (NSBundle.mainBundle().loadNibNamed("CustomCalloutView", owner: self, options: nil))[0] as! CustomCalloutView;
let button = UIButton(frame: CGRectMake(0, 0, 100, 50))
button.addTarget(self, action: Selector("buttonPressed:"), forControlEvents: .TouchUpInside)
button.userInteractionEnabled = true
button.backgroundColor = UIColor.greenColor()
customView.addSubview(button) // assuming you're in a view controller
self.view.addSubview(customView)
}
この行を追加してみてください:customView !canShowCallout = false –
私はすでにそれを行っています。初めてのものです – Jan