繁体   English   中英

如何单击iphone应用程序中的按钮并链接到应用程序中的第二页

[英]how to click on a button in the iphone application and link to a second page within the app

我正在建立一个没有导航栏的基于视图的项目。 我有2页。 只需一个按钮即可从第一页链接到第二页。 然后是一个按钮,用于从第二页链接到第一页。 似乎应该很简单,但我有一段时间想得到它。

- (IBAction) view2ButtonPressed: (id) sender {
    View2Controller *vc = [[View2Controller alloc] initWithNibName:@"View2" bundle:nil];
    [self.navigationController pushViewController:vc animated:YES];
}

然后将按钮的touchedUp操作链接到view2ButtonPressed方法。 (确保同时在.h文件中列出该方法)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM