Iphone presentViewController没有父视图消失
我有一个UIViewController,它在上面-我使用presentViewController显示一个新窗口:Iphone presentViewController没有父视图消失,iphone,user-interface,Iphone,User Interface,我有一个UIViewController,它在上面-我使用presentViewController显示一个新窗口: controller.view.frame = source; [self presentViewController:controller animated:NO completion:nil]; [UIView animateWithDuration:ANIMATION_NORMAL_DURATION animations:^{ controller.view.
controller.view.frame = source;
[self presentViewController:controller animated:NO completion:nil];
[UIView animateWithDuration:ANIMATION_NORMAL_DURATION animations:^{
controller.view.frame = target;
}completion:^(BOOL finished) {
}];
当我这样做时-父控制器(self)在新控制器(controller)出现之前消失。这让它变得丑陋
有没有更好的方法来实施它?
(我在那些ViewController中不使用NavigationController)
谢谢。不显示,只需添加子视图即可
controller.view.frame = source;
//[self presentViewController:controller animated:NO completion:nil];
[self.view addSubview:controller.view];
[UIView animateWithDuration:ANIMATION_NORMAL_DURATION animations:^{
controller.view.frame = target;
}completion:^(BOOL finished) {
}];
iOS7中有modalPresentationStyle属性。 将其设置为以下选项之一:UIModalPresentationOverFullScreen、UIModalPresentationOverCurrentContext、UIModalPresentCustom
modalViewController.modalPresentationStyle=UIModalPresentationCustom代码>您希望产生什么效果?我希望新控制器滑到父控制器(自身)上。现在-父视图消失,只有到那时-新视图才会滑动。谢谢,但是父视图控制器不会对ViewDidDisplay等做出反应。请自己调用它们。例如,在完成块中出现ViewDid是的,这是一个想法。难道没有更优雅的方式吗?