从一个Controller跳转到另一个Controller时,一般有以下2种:
1、利用UINavigationController,调用pushViewController,进行跳转;这种采用压栈和出栈的方式,进行Controller的管理。调用popViewControllerAnimate d方法可以返回。
PickImageViewController *ickImageViewController =[[PickImageViewController alloc] init];
[self.navigationController pushViewController:ickImageViewController animated:true];
[ickImageViewController release];
2、利用UIViewController自身的presentModalViewControll er,进行跳转;调用dismissModalViewControll erAnimated方法可以返回。
PickImageViewController *ickImageViewController =[[PickImageViewController alloc] init];
[selfpresentModalViewControll er:ickImageViewControlleranimated:YES];
//返回
[self dismissModalViewControll erAnimated:YES];
1、利用UINavigationController,调用pushViewController,进行跳转;这种采用压栈和出栈的方式,进行Controller的管理。调用popViewControllerAnimate
2、利用UIViewController自身的presentModalViewControll
//返回
[self dismissModalViewControll
本文介绍了iOS应用中两种常见的控制器之间的跳转方法:使用UINavigationController进行压栈和出栈管理,以及利用UIViewController的presentModalViewController进行模态视图控制器的展示。这两种方式分别适用于不同的场景,并提供了具体的代码示例。
1612

被折叠的 条评论
为什么被折叠?



