4
如何将一个变暗的MKMapView
的背景色和不变暗在MKMapView
的MKOverlay
“在同一时间s - 类似于耐克+应用地图视图。变暗的MKMapView的背景色而不变暗MKOverlay
如何将一个变暗的MKMapView
的背景色和不变暗在MKMapView
的MKOverlay
“在同一时间s - 类似于耐克+应用地图视图。变暗的MKMapView的背景色而不变暗MKOverlay
好的,我在这里得到了解决方案,在将其他叠加层添加到地图之前,可以将总叠加层作为背景添加到地图中,以便地图的背景颜色发生变化,但叠加层仍然像以前一样,这里有码
MKMapRect worldRect = MKMapRectWorld;
MKMapPoint point1 = MKMapRectWorld.origin;
MKMapPoint point2 = MKMapPointMake(point1.x+worldRect.size.width,point1.y);
MKMapPoint point3 = MKMapPointMake(point2.x, point2.y+worldRect.size.height);
MKMapPoint point4 = MKMapPointMake(point1.x, point3.y);
MKMapPoint points[4] = {point1,point2,point3,point4};
self.polygon = [MKPolygon polygonWithPoints:points count:4];
[self.runMapView addOverlay:self.polygon];
雨燕2.0
let worldRect = MKMapRectWorld
let point1 = MKMapRectWorld.origin
let point2 = MKMapPointMake(point1.x + worldRect.size.width, point1.y)
let point3 = MKMapPointMake(point2.x, point2.y + worldRect.size.height)
let point4 = MKMapPointMake(point1.x, point3.y)
var points = [point1, point2, point3, point4]
let polygon = MKPolygon(points: &points, count: points.count)
mapView.addOverlay(polygon)
为什么没有答案被接受?这只是在定制覆盖渲染器子类的一大堆东西后才救了我。 – 2015-04-30 21:05:13