gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 11:20:16 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com