Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a Stationary Button Overtop of a Map View

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.

like image 448
intact700 Avatar asked Dec 04 '11 22:12

intact700


2 Answers

[mapView bringSubviewToFront:button];

Maybe this helps.

like image 54
Mundi Avatar answered Oct 13 '22 04:10

Mundi


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

like image 42
kcharwood Avatar answered Oct 13 '22 05:10

kcharwood