我有以下问题。我想从一个视图转到另一个视图,不是使用按钮,而是编写代码。我有一个视图,其中有一些按钮。当我按下其中一个时,运行 if - else。从其他地方我想去另一个观点。
我试过这个
GameOverViewController *gOver = [[GameOverViewController alloc]initWithNibName:@"GameOverViewController" bundle:nil];
[self.view removeFromSuperview];
gOver.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:gOver animated:YES];
这个
GameOverViewController *gOver = [[GameOverViewController alloc]initWithNibName:@"GameOverViewController" bundle:nil];
[self.view removeFromSuperview];
[self.view insertSubview:gOver.view atIndex:0];
和这个
GameOverViewController *gOver = [[GameOverViewController alloc]initWithNibName:@"GameOverViewController" bundle:nil];
[self.view removeFromSuperview];
[self.view addSubview:gOver.view];
但没有任何效果。有任何想法吗 ?
我也试过这个
GameOverViewController *gOver = [[GameOverViewController alloc]initWithNibName:@"GameOverViewController" bundle:nil];
[self.view setHidden:YES];
[self.navigationController pushViewController:gOver animated:NO];
抛出异常
[self presentModalViewController:gOver animated:YES];
[self.view insertSubview:gOver.view atIndex:0];
[self.view addSubview:gOver.view];
提前致谢