小编bye*_*ute的帖子

iOS 8 MKAnnotationView rightCalloutAccessoryView未对齐

我仍然对iOS的东西很新,并且在测试我们的App for iOS 8兼容性时发现了一个问题.在iOS 7中一切正常,但在iOS 8上,rightCalloutAccessoryView在某些情况下未对齐.

第一个截图:正确对齐 正确对齐

第二个屏幕截图:错误对齐 对齐错误

如您所见,当InfoWindow具有较长的标题时会发生问题.但是在iOS 7上并非如此,我找不到任何提及这已经发生变化的事情?

我试图理解为什么并找到解决这个问题的方法,但还找不到任何东西.这是我们自己可以解决的还是我们必须为Apple提出问题?

任何帮助/想法都会受到高度赞赏,因为我对这个问题有点过分挑战.

添加MKAnnotationViews的代码

- (MKAnnotationView *)viewForStation:(id<MKAnnotation>)annotation {
      static NSString *stationIdentifier = @"stao";
      MKAnnotationView *annotationView = [self.mapView dequeueReusableAnnotationViewWithIdentifier:stationIdentifier];
      if (annotationView == nil) {
          annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation           reuseIdentifier:stationIdentifier];
          annotationView.image = [UIImage bundleImageNamed:PIN_IMAGE];
          annotationView.canShowCallout = YES;
          annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
      }
      return annotationView;
}
Run Code Online (Sandbox Code Playgroud)

您可能感兴趣,我(刚才)也将此问题添加到apple.developer.com上的iOS 8 Beta部分:https://devforums.apple.com/thread/242282 tstart = 0

如果我在这里或在apple.developer.com上得到答案,我会反映它,以便我们可以在两个网站上找到它

mapkit mkannotationview ios ios8

38
推荐指数
3
解决办法
9034
查看次数

标签 统计

ios ×1

ios8 ×1

mapkit ×1

mkannotationview ×1