一,在使用storyboard的情况
1,直接在storyboard创建并且箭头navigation conroller,连线即可
2,使用segue跳转
把界面缩小(你可以在空白的地方双击一下,或者右键选择缩放比例),这次我们不是直接使用“按扭”连接界面,而是进行界面和界面之间的连线,如下图所示:
注意:100%的缩放是不能进行界面和界面之间的连线!
之后的操作和前面的一致,为了容易理解,我还是贴一下图:(直接用show连接)
选中“这条线”,在storyboard segue的identifier指定一个标识符,后面我们会用到:
这时我们需要为按扭添加一个事件,为此需要同时显示storyboard和.m文件,操作如下:
创建事件的操作和之前连线的操作一样:
为这个事件创建一个名字,然后点击connect:
在事件里添加如下代码,把刚连线的identifier传进去,sender一般为self:
[self performseguewithidentifier:@easycode sender:self];
这样,就可以成功跳转了。
二,没用使用storyboard情况下
1,在navigationcontroller作为rootviewcontroller的基础上,
[self.navigationcontroller pushviewcontroller:self.neworderviewcontroller animated:yes];}
2,未测试
presentmodalviewcontroller:newview animated:yes]; //描述:通过事件进行跳转 [self dismissmodalviewcontrolleranimated:yes]; //描述:通过事件进行返回。(在newview中)