タイトルとサブタイトルを表示する注釈付きの mapView があります。字幕が注釈の幅よりも長い場合があるので、複数行にできますか? これまでのところ、次のようにコーディングされています。
func annotate(newCoordinate, title: String, subtitle: String) {
let annotation = MKPointAnnotation()
annotation.coordinate = newCoordinate
annotation.title = title
annotation.subtitle = subtitle
self.map.addAnnotation(annotation)
}
次に、いくつかのオプションを設定します
func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {...}
ここでは関係ありません。
カスタム注釈ビューを作成することは可能ですか? 私はいくつかのことを試しましたが、何もうまくいきませんでした。私が得ることができる最も近いのは、長い字幕を個別に表示するボタンを追加することですが、注釈の中に入れたいと思います。
出来ますか?