ios - 如何使用 iOS swift hero 框架在两个 View Controller 之间进行转换?

标签 ios iphone swift transition uiviewanimation

我有两个 View Controller 。第一个是 tableviewcontroller,另一个是 detailviewcontroller。 Tableviewcontroller 显示图像列表。当用户单击图像时,我想创建一个转换,如下所示。有人有相关项目吗?我认为这种转换称为“Shared Element Transition”。如果我错了帮我改正。帮我用"Hero Library"但替代品也很好。 enter image description here

最佳答案

您必须在 UINavigationController 上启用 Hero(在 Storyboard 中或以编程方式执行)...

您可以使用以下代码以编程方式启用 Hero:

navigationController.hero.isEnabled = true

关于ios - 如何使用 iOS swift hero 框架在两个 View Controller 之间进行转换?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49657316/

相关文章:

iphone - 每次触摸UIButton时将值增加1

swift - Realm 对象服务器。离线对象状态

arrays - 如何在 swift 中实例化一个 Array 类?

iOS 启用 AVPlayer 在后台继续播放

iphone - iPad:如何将iPhone应用程序转换为iPad兼容?

iphone - 如何调用performSelectorOnMainThread : with an selector that takes > 1 arguments?

swift - UITextView:添加GestureRecognizer并找到textView的标签

iOS 从两级模态视图 Controller 传递值

ios - 两分钟gps开启后,为什么设备会停止在iOS上接收位置信息?

ios - m4a 文件格式的 AudioStreamBasicDescription 是什么