gpt4 book ai didi

ios - 如何在 map 上的 iOS 7 中填充外部覆盖圈

转载 作者:可可西里 更新时间:2023-11-01 17:08:04 24 4
gpt4 key购买 nike

我需要与 iOS7 中的提醒应用程序一样在 map 上围绕圆圈填充的空间。我认为需要使用 applyFillPropertiesToContext:atZoomScalefillPath:inContext: 方法。

iOS 7 Reminders

最佳答案

我解决了我的问题:

- (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
{
// Fill full map rect with some color.
CGRect rect = [self rectForMapRect:mapRect];
CGContextSaveGState(context);
CGContextAddRect(context, rect);
CGContextSetFillColorWithColor(context, [UIColor colorWithWhite:0.0 alpha:0.4f].CGColor);
CGContextFillRect(context, rect);
CGContextRestoreGState(context);

// Clip rounded hole.
CGContextSaveGState(context);
CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextSetBlendMode(context, kCGBlendModeClear);
CGContextFillEllipseInRect(context, [self rectForMapRect:[self.overlay boundingMapRect]]);
CGContextRestoreGState(context);

// Draw circle
[super drawMapRect:mapRect zoomScale:zoomScale inContext:context];
}

关于ios - 如何在 map 上的 iOS 7 中填充外部覆盖圈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19984755/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com