您的位置:首页 > 移动开发 > IOS开发

ios ViewController 页面跳转

2014-11-13 16:25 501 查看
从一个Controller跳转到另一个Controller时,一般有以下2种:

1、利用UINavigationController,调用pushViewController,进行跳转;这种采用压栈和出栈的方式,进行Controller的管理。调用popViewControllerAnimated方法可以返回。

PickImageViewController *ickImageViewController = [[PickImageViewController alloc] init]; [self.navigationController pushViewController: ickImageViewController animated:true];

[ickImageViewController release];

2、利用UIViewController自身的presentModalViewController,进行跳转;调用dismissModalViewControllerAnimated方法可以返回。

PickImageViewController *ickImageViewController = [[PickImageViewController alloc] init]; [self presentModalViewController:ickImageViewController animated:YES];

//返回 [self dismissModalViewControllerAnimated:YES];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: