views:

45

answers:

2

Hi,

In my application I have a map, this map has a lot of annotations... but sometimes no location is found for an annotation (server couldn't find lat/lon). When this happens, I would like to draw a little box on my map with the text "Some locations could not be found" (or similar). I want this box to have round corners and to be transperant. Also, if possible I would prefer if this does not effect the functionality of the map. What I mean with that is that if the user draws its finger on the map from where that box is located, the map should still move.

How can I make such a box?

This is what I mean:
alt text

Best regards,
Paul Peelen

+1  A: 

Hi Paul,

Either use Photoshop :), or else do it using CALayer.

To do it with a layer, create a UIView called bgView with the appropriate alpha value for your background and then do this in the method where you want to display the alert panel:-

CALayer *layer = bgView.layer;
layer.masksToBounds = YES;
layer.cornerRadius = 20.0; // adjust for corner effect
Echelon
Your solution worked perfect for me. Easy and little code! Thnx!
Paul Peelen
+1  A: 
Brad
Allright, will try it out soon. How can I make sure it doesn't react on press. I other words that its "press-thru"? Or isn't that possible?
Paul Peelen
not sure. You might send an email to Matt at http://www.uofuiphone.com as he's the one who did the example code.
Brad