ios - 推送 UIViewController
问题描述
有没有办法通过自定义屏幕显示来推送视图控制器?,就像呈现一个视图控制器,modalPresentationStyle = .custom
。!当推送带有自定义动画的视图控制器时,推送的视图控制器会消失。
解决方案
您可以通过在过渡时分配所需的动画来推送:
let yourVC = self.storyboard?.instantiateViewController(withIdentifier: "YOURVIEWCONTROLLER") as! YOURVIEWCONTROLLER
UIView.animate(withDuration: 0.6, animations: {() -> Void in
UIView.setAnimationCurve(.easeInOut)
self.navigationController?.pushViewController(yourVC, animated: true)
UIView.setAnimationTransition(.flipFromRight, for: (self.navigationController?.view)!, cache: false)
})
推荐阅读
- r - 如何调整 R 中的箱线图框的大小以适合绘制的框
- sequelize.js - Sequelize:如何获取最新的唯一记录?
- javascript - Rest API Patch 一次只有 1 个字段
- asp.net - 首次访问时的实体框架性能
- node.js - 尝试在nodejs javascript数组中打印对象密钥对
- vba - PowerPoint VBA - 扩展图表数据范围
- sql - 表锁定 SQL Server 2 会话
- asp.net - 从 adwords 重写查询 URL
- scala - 如何在运行时刷新 application.conf
- php - Get selected values in multiselect form field