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

标签 iphone ios cocoa-touch core-animation uiviewanimation

我有一个 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/

相关文章:

iphone - iOS : UITableView - Adding columns to your table

objective-c - View 转换

iphone - 如何判断您的应用程序是否刚刚打开

iOS:如何使用 UIButton 重新生成 UIImageView

ios - 在 swift 3 中删除 TableView 的特定选择单元格

javascript - 如何修复 'Failed to load resource: The operation couldn' 无法完成。 iOS 12 视频中的“协议(protocol)错误”?

objective-c - 如何制作带有白色文字的蓝色按钮?

iphone - 使用2G,3G,4G网络的iPhone应用程序

iphone - 将格式化的 HTML 文本字符串转换为 NSString 部分

ios - 当我只是将数据存储在内存中(而不是磁盘)时,如何有效地删除我的核心数据存储?