在两个UITableView之间转换时如何模仿UINavigation动画行为

我有一个UIViewController,它包含两个UITableViews和两者之间的交换。 我想知道如何在这两个UITableViews之间转换时实现UINavigationController完全相同的动画行为? (即一个tableView被另一个tableView从左到右或从右到左推离屏幕)。

// Set table 2 up offscreen as starting state CGRect rect = tableView2.frame; rect.origin.x = rect.size.width; tableView2.frame = rect; // fill in any details you need for the animation [UIView beginAnimation:... // move 1 left offscreen rect = tableView1.frame; rect.origin.x = -rect.size.width; tableView1.frame = rect; // bring 2 right onscreen rect = tableView2.frame; rect.origin.x = 0; tableView2.frame = rect; [UIView commitAnimation]; 

你有什么理由不能使用两个UIViewController:s?

如果不是,您应该可以通过设置两个表视图的bounds属性的动画来实现。 你可以通过使用分页滚动视图并只是在页面之间切换来实现它。