如何在xcode中从一个页面导航到另一个页面?请记住,不要使用界面生成器...我想要编程的答案?如果你想获得你想要的东西在xcode中从一个页面导航到另一个页面
回答
虽然你的问题是没有多少明确的,但我还是想给一个尝试...
您可以使用
UIViewController *yourViewController = [[YourViewControllerClass alloc] initWithNibName:@"<name of xib>" bundle:nil];
[self presentModalViewController:yourViewController animated:YES];
[yourViewController release];
在情况下,新观点也是以编程方式创建的,则能做到这一点在YourViewControllerClass的viewDidLoad方法,改变初始化
UIViewController *yourViewController = [[YourViewControllerClass alloc] init];
在YourViewController当你想回来以前查看O ñ一些按钮操作,您可以使用
[self dismissModalViewControllerAnimated:YES];
的另一种方式,你可以做的是
UIViewController *yourViewController = [[YourViewControllerClass alloc] init];
[self addSubview:[yourViewController view]];
,并删除您可以使用
[self.view removeFromSuperview];
希望这对你的作品的看法,如果是请沟通.... :)
PLS更加精确。
如果您正在使用的视图控制器内navigationcontroller你可以利用它的pushViewController:
或presentModalViewController:
的。或者,如果您只想显示另一个视图,则只需将现有视图的下一个视图添加为子视图即可。
我是新来的iphone应用程序开发。我的应用程序中有一个按钮。如果我按下那个按钮,我想进入下一页。我不想为此使用界面生成器。我必须以编程方式进行。如果你有时间意味着请给予编码......提前致谢。 – Aravindhan 2011-03-21 09:16:04
你的应用有导航控制器吗? – visakh7 2011-03-21 09:36:27
亚我在我的应用程序中有navigavion conroller – Aravindhan 2011-03-21 09:55:50
//Appdelegate.m
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
UINavigationController *navigation = [[UINavigationController alloc]initWithRootViewController:self.viewController];
self.window.rootViewController = navigation;
[self.window makeKeyAndVisible];
return YES;
}
//In viewcontroller1.M
- (IBAction)GoToNext:(id)sender
{
ViewController2 *vc2 = [[ViewController2 alloc] init];
[self.navigationController pushViewController:vc2 animated:YES];
}
- 1. 从一个页面导航到另一个页面的选项
- 2. 如何导航一个xaml页面到另一个页面?
- 3. 在ionic2中从一个页面导航到另一个
- 4. 从Silverlight 4中的一个xaml页面导航到另一个xaml页面?
- 5. Flex导航到另一个Mxml页面?
- 6. 离子3从一个页面到另一个页面的角向导航
- 7. 如何从一个页面导航到另一个页面上的hubsection?
- 8. 我需要从一个页面导航到另一个页面上xamarin.Forms.app
- 9. 从一个网站页面导航到另一个网站页面
- 10. 如何从一个页面导航到另一个离子
- 11. 在Silverlight中从一个页面过渡到另一个页面
- 12. 导航到一个页面,并再次到另一个页面顺序
- 13. 多个表单页面提交导航到JSF primeface中的另一个页面
- 14. 如何在Android上从一个页面导航到另一个页面?(共3页)
- 15. 如何从一个页面到另一个页面使用JavaScript?
- 16. 将用户从一个页面带到另一个页面
- 17. 将值从一个页面传递到另一个页面
- 18. 将值从一个HTML页面传递到另一个页面
- 19. 从一个页面移动到另一个页面
- 20. 从一个页面输入的信息到另一个页面
- 21. 从一个页面到另一个页面+区域的URL
- 22. 将var从一个页面传递到另一个页面
- 23. 如何从一个页面到另一个页面
- 24. 在Smartface App Studio中从一个页面导航到另一个页面需要很长时间
- 25. 如何在angularjs中从一个页面导航到另一个页面时保留$ scope值
- 26. 在Silverlight中,如何启动/导航到另一个页面?
- 27. 延迟导航到下一个页面
- 28. 从Silverlight accordionitem导航到另一个xaml页面
- 29. 使用反应从页面导航到另一个
- 30. 我需要一个会话变量,从一个页面到另一个页面,因为我从一个页面移动到另一个页面vb.net
更多的问号,你每个句子后,把少你的机会来得到答案。真的 – Vladimir 2011-03-21 09:01:21
你的问题是什么? – Rog 2011-03-21 09:03:43