开发者

How can i go from a mapview to a simple view

开发者 https://www.devze.com 2023-01-09 07:50 出处:网络
I am working on an app in which the starting point is a map and it has a button too. What i want is that if user clicks the button it will take him to another view which just have two or three buttons

I am working on an app in which the starting point is a map and it has a button too. What i want is that if user clicks the button it will take him to another view which just have two or three buttons or other elements.

P开发者_StackOverflowlease provide me with detail answer so that i would be able to do it.

Thanks in advance, i would really appreciate it.


just put this code inside your button action and change it your needs

YourViewControler *yourViewControler = [[YourViewControler alloc]            initWithNibName :@"YourViewControler" bundle:nil];

[self.navigationController pushViewController:yourViewControler animated:NO];

[yourViewControler release];

and you can add anything in YourViewControler.

I hope it will help you.


That could be achieved in a lot of ways. For example you could use a controller for each view you need and switch between them with the use of a UINavigationController. Use the map controller as the root of the navigation controller, then when the user presses the button just call pushViewController:animated:

0

精彩评论

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