UIModalTransitionStyle有四种方式:
CoverVertical: 从底部升上来
CrossDissolve:快速闪现
FlipHorizontal:卡片翻转形式
@IBAction func onShowInfo(sender: AnyObject) {
//实例化一个得分规则界面
let controller = InfoViewController(nibName: "InfoViewController",bundle: nil)
//规则界面出现的动画方式
controller.modalTransitionStyle = UIModalTransitionStyle.CoverVertical
//界面跳转
self.presentViewController(controller,animated:true,completion:nil)
}
@IBAction func onBack(sender: AnyObject) {
//移除自身(关闭当前界面,返回主界面)
self.dismissViewControllerAnimated(true,completion: nil)
}
原文链接:https://www.f2er.com/swift/326375.html