我正在创建一个具有主TableView的应用程序。当我们点击任何单元格时,我们得到了该单元格的DetailView。我们也可以通过在每个DetailView上使用next和prev按钮来更改DetailView而无需返回主TableView。当我点击上一步按钮。我之前的项目是DetailView,但动画就像它的未来一样。我用这个:
[self.navigationController pushViewController:prevView animated:YES];
任何人都可以告诉我如何更改动画,如后退按钮动画。
提前完成
答案 0 :(得分:1)
您必须存储您的navigationController,然后使用动画“弹出”当前视图并“推送”没有动画的详细视图,例如Squeegy here。我稍微调整了Squeegy的代码,以下内容应该有效:
// locally store the navigation controller since
// self.navigationController will be nil once we are popped
UINavigationController *navController = self.navigationController;
// retain ourselves so that the controller will still exist once it's popped off
[[self retain] autorelease];
// Pop this controller and replace with another
[navController popViewControllerAnimated:YES];
[navController pushViewController:prevView animated:NO];