view 1 is current view
view 2 is view to push
是否有可能
view 1 draw at top layer
view 2 draw at bottom layer
将视图 1 向下移动到屏幕外,同时将 CGAffineTransformMakeScale 视图 2 从 0.1 移动到 1.0
我怎样才能做到这一点 ?
更新
我想将所有屏幕(包括导航控制器)移动到屏幕底部。那么我的问题是,当我将 navigationController 向下移动后,我在 navigationController 上绘制这两个层时,这两个层都会坚持使用 navigationController
我如何在 navigationController 后面创建一个临时视图 viewTopush(View 2) 并做动画
这是我的代码,但它还没有工作。
RO_GALViewController *galView = [[RO_GALViewController alloc] initWithNibName:@"RO_GALViewController" bundle:nil];
UINavigationController* navigationController;
CGRect frame;
navigationController = [self navigationController];
frame = [navigationController.view convertRect:self.view.frame fromView:self.view.superview];
galView.view.frame = frame;
galView.view.transform = CGAffineTransformMakeScale(0.1,0.1);
galView.view.alpha = 0;
UIView *blackView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
blackView.backgroundColor = [UIColor blackColor];
blackView.alpha = 0;
[[self navigationController].view addSubview:blackView];
[[self navigationController].view addSubview:galView.view];
[navigationController.view bringSubviewToFront:self.view];
[UIView animateWithDuration:1.3f
delay:0.0f
options:UIViewAnimationCurveEaseInOut
animations:^{
galView.view.alpha = 1.0f;
galView.view.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
navigationController.view.frame = CGRectMake(self.view.frame.origin.x, 460, self.view.frame.size.width, self.view.frame.size.height);
} completion:^(BOOL finished) {
[[self navigationController] pushViewController:galView animated:NO];
}];