NavigationViewController
来源:互联网 发布:java mail ssl 编辑:程序博客网 时间:2024/06/05 19:14
使用NavigationViewController进行页面跳转时,应该使用pushViewController方法来跳转至下一页面,这样的话,下一页面同样在NavigationViewController容器中。
1、跳转到下一页面:
1
2
3
4
5
AloneSetPrizeViewController *setPrize = [[AloneSetPrizeViewController alloc] init];
//所要跳转页面AloneSetPrizeViewController中有个属性dictionary1是个NSMutableDictionary类型的容器
[setPrize.dictionary1 setObject:[self.txtPassWd text] forKey:ALONE_SITEPRIZE_PWD];
//使用pushViewController跳转到下一页面
[self.navigationController pushViewController:setPrize animated:
true
];
2、从当前页面返回到上一页面并传值过去:
1
2
3
4
5
6
7
8
//此页面已经存在于self.navigationController.viewControllers中,并且是当前页面的前一页面
AloneSetSiteViewController *setPrizeVC = [self.navigationController.viewControllers objectAtIndex:self.navigationController.viewControllers.count-
2
];
//初始化其属性
setPrizeVC.dictionary = nil;
//传递参数过去
setPrizeVC.dictionary = [NSMutableDictionary dictionaryWithDictionary:self.dictionary1];
//使用popToViewController返回并传值到上一页面
[self.navigationController popToViewController:setPrizeVC animated:
true
];
返回到上一页后,上一页面显示后要接收参数,并刷新。注意此时应该在viewDidAppear中进行判断并接收传递的值:
1
2
3
4
5
-(
void
)viewDidAppear:(BOOL)animated
{
//判断并接收返回的参数
}
3、从当前页面返回到上一页面(无需传值)的方法:
1
2
3
4
5
//返回到上一界面
-(IBAction)backOff:(id)sender
{
[self.navigationController popViewControllerAnimated:
true
];
}
0 0
- NavigationViewController
- NavigationViewController
- NavigationViewController 返回到根视图
- NavigationViewController的backBarButtonItem的设置技巧 ...
- ios--NavigationViewController跳转、返回传值
- ios--NavigationViewController返回并刷新UITableView页面
- ios--NavigationViewController返回并刷新UITableView页面
- ios--NavigationViewController跳转、返回传值
- ios--NavigationViewController跳转、返回传值
- ios NavigationViewController跳转以及返回传值
- NavigationViewController的backBarButtonItem的设置技巧
- 关于navigationViewController与tabViewController组合使用的问题
- 用UIButton实现页面跳转(AppDelegate +NavigationViewController)
- 解决含有 TabbarVC的 UIViewController 在 NavigationViewController显示时变换的问题
- 福利啦,javaweb悬浮广告的js代码
- 一个使用WordNet比较词语相似度的Java包——JWS(Java WordNet Similarity)
- Android 开源项目收集
- 第一周项目三 时间类(2)增加多秒/分/时
- MySQL导出数据库结构出现Cannot load from mysql.proc错误的解决方法
- NavigationViewController
- httpclient支持https,http请求
- xxx应用在后台时,突然提示"很抱歉,xxx已停止运行"
- selenium 2 关于移动端wap网页的测试,3种解决思路。
- Unable to compile class for JSP 解决办法
- Android:设计之屏幕适配
- cocos: command not found
- xib自定义cell,返回cell高度
- 通过经纬度确定一定范围内哪些门店离客户最近,如1000米内有哪些最近的某某门店