【发布时间】:2011-05-02 21:20:43
【问题描述】:
我想将图像显示为 MKMapView 的叠加层。
图像已显示,但问题是它不适合 mkmapview 的可见矩形,它显示的是 4 张图像而不是 1 张。
我该如何解决。 图片截图
- (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context {
UIGraphicsPushContext(context);
CGRect rect=[self rectForMapRect:mapRect];
NSLog(@"rect width:%f height:%f",rect.size.width,rect.size.height);
[scaledImage drawInRect:[self rectForMapRect:mapRect] blendMode:kCGBlendModeNormal alpha:1.0];
//[scaledImage drawInRect:CGRectMake(0, 0, 320, 367) blendMode:kCGBlendModeOverlay alpha:.07];
UIGraphicsPopContext();
}
即使我尝试调整图像大小但没有用..
【问题讨论】:
-
请检查您添加的叠加图像的框架。请发布您的代码
-
嗨..,我发布了代码..