开发者

SetNeedsDisplayInRect not taking effect immediately

开发者 https://www.devze.com 2023-01-06 08:50 出处:网络
When I call setNeedsDisplayInRect:, why isn\'t my drawRect:inContext method being called soon after? If I zoom into the unpainted area, then zoom out (I guess triggering a repaint) the image will be d

When I call setNeedsDisplayInRect:, why isn't my drawRect:inContext method being called soon after? If I zoom into the unpainted area, then zoom out (I guess triggering a repaint) the image will be drawn. But if I leave it sitting there, no dice. Is there a way to force a repaint immediately?

Just in case it matters, I'm really using MapKit's o开发者_如何学Pythonverlays and the setNeedsDisplayInMapRect:zoomScale: and drawMapRect:zoomScale:inContext: methods, but I had this problem previously with just a scrollview and a CATiledLayer.


shouldn't you be using

  • (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context

not drawRect:inContext:

0

精彩评论

暂无评论...
验证码 换一张
取 消