从已有View Controller下面展示新的View Controller
从已有View Controller上面展示新的View Controller
当前View上再展示一个新的View并与当前View进行交互,比如iPhone自带的日历:
其实现步骤为:
- 创建想要显示的View
- 设置modalTransitionStyle属性, 设置显示的动画内容
- 给将显示的View分配delegate
- 调用方法 presentViewController:animated:completion:显示新建的View
例如:
TestViewController *tvc = [[TestViewController alloc] init]; tvc.delegate = self; tvc.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:tvc animated:YES completion:nil];