2

私はいくつかのことを試しましたが、それを解決することはできません。

表示される領域に応じて、マップ上に 10 個のカスタム アノテーションがあります。

これで、次と前の 2 つのボタンができました。注釈のコールアウトを表示する必要がある場所をクリックします。

つまり、次のボタンをクリックすると、注釈 1 の吹き出しが表示され、もう一度 [次へ] をクリックすると、最初の吹き出しが非表示になり、2 番目の吹き出しが表示されます。

私は試してみました

[self.mapView selectAnnotation:self.nextSelectedAnnotationView.annotation animated:YES]

[self.mapView deselectAnnotation:self.selectedAnnotationView.annotation animated:YES];

しかし、主な問題は、ここで注釈を取得する方法です??

NSArray* selectedAnnotations=self.mapview.annotations注釈配列を取得しようとしました

id annotationView =[selectedAnnotations objectAtIndex:i];
[self.mapView selectAnnotation:annotationView animated:YES];

しかし、運が悪い:(

私の問題を解決する他の方法.??

4

1 に答える 1

0

それはあなたを助けるかもしれません。

 NSArray *selectedAnnotations = mapView.selectedAnnotations;
for(id annotationView in selectedAnnotations) {
    [mapView deselectAnnotation:[annotationView annotation] animated:NO];
}
于 2011-07-12T12:44:03.757 に答える