views:

22

answers:

2

I am working with creating a simple iPhone app to show a map and some labels, however the MKMapView likes being centered when I put it in the interface builder.

I am very new to this, so i apologize for my ignorance.

I cannot seem to find a way to move the MKMapView from its centered position. I can scale the edges, however the scaling is mirrored on both sides and it does not let me alter the x and y value manually. I want to move the MKMapView to the top of the screen and have some labels on the bottom, however I don't want any extra space at the top.

Is there any method I can use (either within the Interface Builder OR in the actual Objective C code) which will let me move the MKMapView more freely?

Thank you, -Serge

A: 

It sounds like you're attempting to place it in a bare window. If you want to position it on a portion of the screen somewhere you'll want to place a regular View in the window first (that could just fill the window), then put the MKMapView on that view. You'll be able to move it to wherever you'd like.

Matthew Frederick
Alright, thanks Matthew, but I must ask: how do I enable a view, or add one? I'm sure its something simple, but I do not know how to deal with these things at the moment. As well as this, what sort of in-code references would I need to change (just a generalized answer will do)
Serge
In Interface Builder, from the Library window drag a View onto the window directly, or if that's troublesome you can drag it onto the list area and let go when the Window is highlighted. Then you can drag a new MKMapView onto that View the same way. You should now be able to resize it.In XCode create a MKMapView instance variable in your view controller.In Interface Builder control-click on the text labeled "File's Owner." Click on the circle next to the word "view" and drag it to the View item lower in the list. Click on the circle next to your variable and drag to the MKMapView line.
Matthew Frederick
A: 

@Matthew: I din't get it can you explain the last part more clearly. I mean the part where we need to drag something to MKMapView.

Thanks,

Ashutosh