0

I have a map with many (>500) custom annotation views. Currently I am using a UIView that implements the drawRect: method which then draws the annotations view with UIBezierPath and other vectorish methods (from PaintCode). I have noticed however that when loading the map it sometimes takes quite a bit of time for the pins to show up. Would it be better to use a transparent PNG or SVG? What is less memory and processor intensive? What is the best practice?

Thanks

4

1 回答 1

1

使用加载图像文件[UIImage imageNamed:]似乎比调用每个.drawRectUIBezierPathUIView

drawRect每当需要更新视图时也会调用它,因此它可能会被调用多次。

[UIImage imageNamed:]另一方面,缓存图像,这是另一个优化。

于 2014-02-08T19:59:49.427 回答