自定义 UIViewController 容器在两个视图之间交换

发布于 2024-12-28 07:54:48 字数 694 浏览 1 评论 0原文

我想重现 Apple 的 TheElementes 示例中的 UIView 交换效果代码,其中点击 UINavBar 中的按钮会导致导航下方的视图翻转并被另一个视图替换。

我想知道是否可以更新此代码以利用 iOS 5 中引入的自定义 UIViewController 容器。而不是使用一个 UIViewController 来交换两个 UIViews ,它会有一个容器 UIViewController ,可以在两个 UIViewControllers 之间交换(在我的例子中是一个普通的 UIViewController 和一个 UITableViewController代码>)。我想它也可能涉及创建一个自定义故事板转场。

有人对此有任何见解吗?

如果只有一个 ViewController 更好,那么它应该是常规视图控制器子类还是 UITableViewController 子类?初始视图应该是普通的 UIView,但第二个视图应该是 UITableView。哪个会更容易?

I'd like to reproduce the UIView swapping effect from Apple's TheElementes sample code where tapping a button in the UINavBar causes the view below the the Nav to flip around and get replaced with another view.

I'm wondering if this code could be updated to take advantage of custom UIViewController containers introduced in iOS 5. Instead of having one UIViewController that swaps two UIViews, it would have a container UIViewController that swaps between two UIViewControllers (in my case a normal UIViewController and a UITableViewController). I imagine that it could involve creating a custom story board segue as well.

Does anyone have any insight on this?

If it is better to just have one ViewController should it be a regular view controller subclass or a UITableViewController subclass? The initial view should be a normal UIView but the second view is supposed to be a UITableView. Which would be easier?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文