[IOS]页面跳转 相关
来源:互联网 发布:淘宝卖家密码修改 编辑:程序博客网 时间:2024/04/27 08:06
[IOS]页面跳转 相关
用伪代码只记方法关键,过程能省我就省了,基本方法有三。
有两个继承于UIViewController的类: FristVC 和SecondVC.
效果:
在FristVC的View中放一个ButtonOne,点击后跳转至SecondVC的View;在SecondVC的View上放一个ButtonTwo ,点击后返回FristVC的View。
方法之一:
@property (strong,nonatomic)SecondVC *secondView;//FristVC部分-(void)buttonOneInside: (id)sender{ self.secondView = [[SecondVC alloc] initWithNibName:@ “SecondVC” bundle:nil ] [self.view addSubView:self.secondView];}//SecondVC部分-(void)buttonTwoInside: (id)sender{ [self.view removeFromSuperView];}
方法之二:
//FristVC部分-(void)buttonOneInside: (id)sender{ self.secondView = [[SecondVC alloc] initWithNibName:@ “SecondVC” bundle:nil ] [self presentViewController:self.secondview animated:YES completion:^{}]; }//SecondVC部分-(void)buttonTwoInside: (id)sender{ [self dismissViewControllerAnimated:YES completion:^{}];}
方法之三:
导航条跳转 UINavigationController
UINavigationController相当于是一个容器,然后将所有的view都放到这个容器里面去,有一对方法push和pop 用于把View推进和推出。
//代理 。m部分:self.fristView = [[FristVC alloc] initWithNibName:@ “FristVC” bundle:nil ]//把rootView设置为firstViewUINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:self.fristView]; //FristVC部分-(void)buttonOneInside: (id)sender{ self.secondView = [[SecondVC alloc]initWithNibName:@ “SecondVC” bundle:nil ] [self.navigationController pushViewController:self.secondView animated:YES];}//SecondVC部分-(void)buttonTwoInside: (id)sender{ [self.navigationController popViewControllerAnimated:YES];}
0 0
- [IOS]页面跳转 相关
- iOS App 跳转到本App相关设置页面
- Servlet页面跳转相关
- jsp 相关页面跳转
- ios 页面跳转问题
- ios 页面跳转
- IOS之页面跳转
- iOS 页面跳转方式
- ios ViewController 页面跳转
- IOS 页面跳转
- ios页面跳转基础
- ios ViewController 页面跳转
- ios ViewController 页面跳转
- ios ViewController 页面跳转
- ios ViewController 页面跳转
- ios ViewController 页面跳转
- IOS页面跳转方法
- iOS页面跳转
- html学习-day02:div布局与css控制
- 关于unix domain socket的一个文章
- 小结
- django session xxx is not JSONSerializer
- Mathematics for 3D Game Programming and Computer Graphics - Rotation Transforms About Arbitrary Axis
- [IOS]页面跳转 相关
- rtsp时间戳计算方法
- iChinese Menu
- 菜鸟潇寒学习库----静态库
- 《unix环境高级编程》书中源代码编译问题解决
- struts2 对ajax的支持
- 配置mysql 5.6免安装版
- 关于computeScroll()方法与Scroller,startScroll
- win8.1 Android SDK Manager 闪退的真正解决办法