私はあまりにもこれらのクラスを使用してiOS 6
で同じ問題に直面しました。これらの変更は、私の仕事:
この方法では1)変更:
あなたが行の順序を次のようにマップビュークラス
(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView*)view
に実装します。この方法
self.selectedAnnotationView = view;
[self.mapView addAnnotation:self.calloutAnnotation];
2)CalloutMapAnnotationView.mファイル
- (void)adjustMapRegionIfNeeded in this method first 5 lines like bellow
CGFloat xPixelShift = 0;
if ([self relativeParentXPosition] < 38) {
xPixelShift = 38 - [self relativeParentXPosition];
} else if ([self relativeParentXPosition] > self.frame.size.width - 38) {
xPixelShift = (self.frame.size.width - 38) - [self relativeParentXPosition];
}
3)同じクラスCalloutMapAnnotationView.mにおいて - 同じクラスCalloutMapAnnotationView.mでCGFloat parentX = [self relativeParentXPosition];
行の後、この方法で(void)drawRect:(CGRect)rect
上記rect = self.bounds;
このライン 追加次の行
if ([self relativeParentXPosition] < 38) {
parentX = 38;
} else if ([self relativeParentXPosition] > self.mapView.frame.size.width - 38) {
parentX = [self relativeParentXPosition]-25;
}
4)。
- (void)didMoveToSuperview {
[super didMoveToSuperview];
[self.superview bringSubviewToFront:self];
}
あなたは、彼らが5 &のiOSは6 あなたはあなたの要件に応じて必要な変更を行う必要があり、両方のiOSで問題なく動作し、直接上記のクラスを使用し、それらを使用することができます。
ありがとう、このソリューションも私を助けました。 –
それは本当に助けになった素晴らしい答え。ありがとう、相棒。 –
hello ios rider – 08442