- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在使用这行代码关闭我的 View Controller self.dismiss(animated: true, completion: nil)
,但我不喜欢当前的动画。相反,我想从左向右滑动。下面是我尝试测试动画的尝试,但没有用。
UIView.animate(withDuration: 1.0, delay: 0.0, options: UIViewAnimationOptions.curveEaseIn, animations: {
let transition = CATransition()
transition.duration = 10
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromLeft
self.view.layer.add(transition, forKey: kCATransition)
self.dismiss(animated: false, completion: nil)
}, completion: nil)
最佳答案
let transition: CATransition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
transition.type = CATransitionType.reveal
transition.subtype = CATransitionSubtype.fromRight
self.view.window!.layer.add(transition, forKey: nil)
self.dismiss(animated: false, completion: nil)
关于ios - 使用自定义动画关闭 View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38799143/
我是一名优秀的程序员,十分优秀!