我正在通過MKMapView繪製MKPolyLine。在iOS 10之前工作正常。在iOS 10中,它顯示了路線以外的顏色補丁。
- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay
{
[![enter image description here][1]][1]if ([overlay isKindOfClass:[MKPolyline class]]) {
MKPolyline *route = overlay;
@try {
MKPolylineRenderer *routeRenderer = [[MKPolylineRenderer alloc] initWithPolyline:route];
routeRenderer.strokeColor = [UIColor colorWithRed:20/255.0 green:153/255.0 blue:255/255.0 alpha:1.0];
routeRenderer.lineWidth = 3;
[routeRenderer setNeedsDisplay];
return routeRenderer;
}
@catch (NSException *exception) {
NSLog(@"exception :%@",exception.debugDescription);
}
}
else return nil;
}
好的好友,謝謝你的回覆。我會檢查並讓你知道 – Mahendra