我在導航控制器中使用自定義展開segue,在動畫中導航欄在動畫過程中不可見,當動畫結束導航欄時彈出」。 ¿如何在動畫期間保留導航欄的可見性?UINavigation Bar在動畫中不可見的自定義展開segue
更多細節:
我在調用模式視圖性能達到這個動畫導航欄上的按鈕,新的觀點有一個按鈕來觸發回捲SEGUE動畫視圖成長而消失,而這動畫正在執行目標視圖控制器中的導航欄在動畫完成之前不可見。
這是我用於自定義賽格的代碼。
- (void) perform {
UIViewController *sourceViewcontroller = self.sourceViewController;
UIViewController *destinationViewcontroller = self.destinationViewController;
[sourceViewcontroller.view.superview insertSubview:destinationViewcontroller.view atIndex:0];
[destinoViewcontroller beginAppearanceTransition:YES animated:YES];
[UIView animateWithDuration:0.2
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
origenViewcontroller.view.transform = CGAffineTransformMakeScale(1.5, 1.5);
origenViewcontroller.view.alpha = 0.0;
}
completion:^(BOOL finished){
[destinationViewcontroller.view removeFromSuperview];
[sourceViewcontroller dismissViewControllerAnimated:NO completion:NULL];
}];
}
好了,我想我得到了它,我所做的是插入整個導航控制器視圖源視圖的上海華和移除代碼從上海華刪除目的地視圖和設置爲YES 的的選擇dismissViewControllerAnimated這樣的:
- (void) perform {
UIViewController *origenViewcontroller = self.sourceViewController;
UIViewController *destinoViewcontroller = self.destinationViewController;
[origenViewcontroller.view.superview insertSubview:destinoViewcontroller.navigationController.view atIndex:0];
[UIView animateWithDuration:0.4
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
origenViewcontroller.view.transform = CGAffineTransformMakeScale(2.0, 2.0);
origenViewcontroller.view.alpha = 0.0;
}
completion:^(BOOL finished){
[origenViewcontroller dismissViewControllerAnimated:YES completion:NULL];
}];
}
我仍然不知道這是做了正確的道路。
歡迎來到SO!如果您嘗試發佈您正在使用的代碼的示例,這樣做通常很有用,這樣人們可以查看它來嘗試和幫助您。 –