xcode中怎么做到点击按钮从当前页面转入一个新的页面?
问题描述:
我是个初学者,只有简单的了解MVC和一些简单的api,我想知道我做一个登录界面,怎么让我点击登录之后进入下一个应用界面呢?大牛给详细的解答好吗,谢谢大神。
答
从A页面跳到B页面
1.ViewControllerB *B=[[ViewControllerB alloc] init];
[self.navigationController pushViewController: B animated:true];
2.ViewControllerB *B=[[ViewControllerB alloc] init];
[self presentModalViewController:B animated:YES];
3.直接在StoryBoard上操作。
首先,按住control,按照红色箭头(A->B)的起始位置拖动。
其次,点击黑色箭头指向的segue;
最后,在黑框中自定义 identifier ,假如identifier 为 haha
一句代码就可以实现。
[self performSegueWithIdentifier: haha sender: self ];
不明白再联系我。
答
导航栏(push)转化、模态方式(present)