Question

I have a really quick question which is probably ridiculously simple. I currently have an application that I am using route-me and OpenStreetMap, and basically I have a view that loads the map into the entire window.

When trying to run the project with a button added to this view in Interface Builder, the map loads overtop of the button, and is not displayed.

The map view is loaded by a custom class RMMapView (route-me class), and I already know how to add markers to the map itself, but not a stationary button in the corner of the screen that won't move as the user drags the map around. I want to add the button as an overlay, a view overtop of the map view itself.

If you guys could give me any tips on how to do this I would greatly appreciate it.

Thanks.

Was it helpful?

Solution

[mapView bringSubviewToFront:button];

Maybe this helps.

OTHER TIPS

Add the mapView as a subview to a view, and add the button as a subview to the same view.

In Interface Builder, on the left side pane that has all the scenes, switch the positions of the button and the MapView. If the button is listed above the MapView, drag it down so it's below it.. or vice versa. This will change which view is on top of the other.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top