我有一个 UIViewController,它包含两个 UITableView 并在两者之间交换。我想知道在这两个 UITableView 之间转换时如何实现与 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];
关于iphone - 在两个 UITableView 之间转换时如何模仿 UINavigation 动画行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7590404/