自定义segue的方向
来源:互联网 发布:数据分析合同 编辑:程序博客网 时间:2024/05/19 18:11
花了挺久时间,终于通过google在stake overflow上找到了解决方式。
总结一下:重写一个custom的segue,在storyboard的右边设置segue为custom,并设置其对应的class。
、
创建一个segue的类,继承UIStoryboardSegue,代码如下:
import UIKit
class SegueFromTop: UIStoryboardSegue {
overridefunc perform()
{
let src =self.source
let dst =self.destination
src.view.superview?.insertSubview(dst.view, aboveSubview: src.view)
dst.view.transform =CGAffineTransform(translationX:0, y: -src.view.frame.size.height)
UIView.animate(withDuration:0.25,
delay: 0.0,
options: UIViewAnimationOptions.curveEaseInOut,
animations: {
dst.view.transform =CGAffineTransform(translationX:0, y: 0)
},
completion: { finished in
src.present(dst, animated:false, completion: nil)
}
)
}
}
- 自定义segue的方向
- 自定义segue
- iOS自定义segue和自定义segue转场动画
- 自定义竖直方向的ViewPager
- SEGUE
- Segue
- 在Storyboard中使用自定义的segue来实现动画过渡
- Android 自定义UI-垂直方向的SeekBar
- Android自定义垂直方向的ViewPager
- 自定义竖直方向的seekbar(一)
- Android 自定义UI-垂直方向的SeekBar
- 自定义垂直方向滑动的ViewGroup
- 怎么使用自定义segue,实现波纹跳转
- Storyboard-segue的使用
- UINavigationController及Segue的使用
- iOS中segue 的使用方法
- iOS8 action segue的变化
- storyboard的segue返回方法
- POJ
- 博弈——GG and MM
- DevOps企业实践指南(9): ITSM与Agile的融合
- python统计文本中单词出现次数
- 核+X参赛小作品:拟真核电厂控制台
- 自定义segue的方向
- matlab中矩阵运算函数
- MATLAB中符号运算
- MATLAB绘制图形
- CodeForces
- MATLAB编程(1),循环和选择
- 轻量级自动化运维工具fabric使用与安装
- 小明学C++第五篇:操作系统
- [BZOJ2733][HNOI2012]永无乡(平衡树+启发式合并)