开发者

How to switch from a menu with a PNG image to a mapview when a button is pressed

I have created a my own background in photoshop and have imported it into my project. This image is the main menu of the project and it has 5 buttons on it. 2 of the buttons are links and they work perfectly wh开发者_StackOverflowile the other 3 involve the app to switch views. Button 1 involves me creating a mapview but when I click the button in the simulator it comes out of the app.

The code works perfectly on its own and it has the standard, hybrid and satellite views as well as map annotation.

How do I code it that when I press the getlocation button in the main menu that it will jump to a mapview?


If it is a different view controller (i.e. another .h, .m, and .xib files), then use this code:

MapViewController *vc = [[MapViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:vc animated:YES];

Or, if it is a UIView in the same view as your buttons, then use this code:

[self.view bringSubviewToFront:mView];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜