菜鸟教程小白 发表于 2022-12-11 18:07:37

ios - map 路线 View 未正确显示


                                            <p><p>我实现了一个 map ,它运行良好。但是当我尝试放大 map 时,我看到了这个问题:</p>

<p> <a href="/image/215GW.jpg" rel="noreferrer noopener nofollow"><img src="/image/215GW.jpg" alt="enter image description here"/></a> </p>

<p>这是我的代码:</p>

<pre><code>-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id&lt;MKAnnotation&gt;)annotation
{
    MKAnnotationView* annotationView = [ initWithAnnotation:annotation reuseIdentifier:@&#34;LocationPin&#34;];
    if () {
      annotationView.image = ;
      return annotationView;
    } else if (){
      annotationView.image = ;
      return annotationView;
    }

    return nil;
}

- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id&lt;MKOverlay&gt;)overlay {
    @autoreleasepool {
      if (]) {
            MKPolylineRenderer *renderer = [ initWithOverlay:overlay];
            ;
            ;
            return renderer;
      }
      return nil;
    }

}
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>这可能与缩放时重绘折线有关。检查这个答案。 <a href="https://stackoverflow.com/questions/13569327/zoom-mkmapview-to-fit-polyline-points" rel="noreferrer noopener nofollow">Zoom MKMapView to fit polyline points</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios -map 路线 View 未正确显示,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/40777494/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/40777494/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - map 路线 View 未正确显示