使用 UINavigationController 链接 UIViewControllers 推送和弹出动画关闭/呈现模式视图?
我有一个带有(导航控制器)的视图控制器,可以在两个视图(列表和地图)之间翻转,用户可以在视图之间切换。地图是模态视图。目前,我已经使用“
当用户选择一个位置时,它将沿着层次结构向下移动并显示一些位置详细信息”来完成此操作。在此层次结构中,用户仍然可以选择查看地图。如果我立即调用 UIViewController 方法 - ( void)presentModalViewController:(UIViewController *)modalViewControlleranimated:(BOOL)animated 它同时执行两个动画,看起来有点混乱。
就目前情况而言,我决定添加一个短 NSTimer 来延迟 - (void)presentModalViewController:(UIViewController *)modalViewControllerAnimated:(BOOL)animated 的调用。
我的问题是,有没有更干净的方法来做到这一点?我想一个类似的例子是,如果您正在使用 App Store 应用程序并且您已经下载了一个新应用程序。应用程序商店存在,然后动画到应用程序的最后一页(假设您还不在那里),我正在寻找这种动画风格。
非常感谢
I have View Controller with a (navigation controller) that can flip between 2 views (list and map), the user can switch between views. The map is the modal view. Currently I have done this using
When the user selects a location it will go down a hierarchy and present some location details. In this hierarchy the user still has the option to view the map. I am currently taking the user back to the root controller using the UINavigationController method - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated with animated being YES, if I immediately call the UIViewController method - (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated it does both animations together, looking a little messy.
As it stands I decided to add a short NSTimer to delay the - (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated being called.
My question, is there a cleaner way of doing this? A similar example I suppose is if you're using the App Store application and you've downloaded a new app. The app store exists then animates to the last page of apps (assuming you're not there already), I'm looking for this style of animation.
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您走在正确的轨道上,但您可以通过使用跳过使用 NSTimer 的步骤
performSelector:withObject:afterDelay:
You are on the right track but you can skip the step of using the NSTimer by using
performSelector:withObject:afterDelay: