当前位置: 首页 > news >正文

淘宝美工培训班东莞百度推广优化排名

淘宝美工培训班,东莞百度推广优化排名,怎么做网站评估,惠州网站建设英语UINavigationController内部页面跳转默认为左右切换,但是当我们想向上弹出进入界面,或者向下离开界面时,需要实现UINavigationControllerDelegate 协议自行控制页面的动画(否则直接在navVc上叠加动画会导致动画结束后的那个页面,自…

UINavigationController内部页面跳转默认为左右切换,但是当我们想向上弹出进入界面,或者向下离开界面时,需要实现UINavigationControllerDelegate 协议自行控制页面的动画(否则直接在navVc上叠加动画会导致动画结束后的那个页面,自动加了异常动画),本文介绍这个实现方案。

定义一个类实现 UIViewControllerAnimatedTransitioning协议,实现下面的函数:


class NavigationControllerAnimation: NSObject, UIViewControllerAnimatedTransitioning {let operation: UINavigationController.Operationinit(operation: UINavigationController.Operation) {self.operation = operationsuper.init()}//页面过渡动画时间 func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {return 0.3}//加页面过渡的动画public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {guard let fromViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from),let toViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) else { return }let containerView = transitionContext.containerViewif operation == .push {// do your animation for pushtoViewController.view.frame = containerView.bounds.offsetBy(dx: 0, dy: containerView.frame.size.height)fromViewController.view.frame = containerView.boundscontainerView.addSubview(toViewController.view)UIView.animate(withDuration: transitionDuration(using: transitionContext),delay: 0,options: [ UIView.AnimationOptions.curveEaseOut ],animations: {toViewController.view.frame = containerView.bounds},completion: { (finished) intransitionContext.completeTransition(true)})} else if operation == .pop {// do your animation for popcontainerView.addSubview(toViewController.view)containerView.addSubview(fromViewController.view)//containerView 上加的view在动画结束后一段时间后被释放了fromViewController.view.frame  = containerView.bounds
//            toViewController.view.frame = containerView.boundsUIView.animate(withDuration: transitionDuration(using: transitionContext),animations: {fromViewController.view.frame = containerView.bounds.offsetBy(dx: 0, dy: containerView.frame.size.height)},completion: { (finished) intransitionContext.completeTransition(true)})}}
}

UINavigationController 添加delegate


class BaseNavigationController: UINavigationController {override func viewDidLoad() {super.viewDidLoad()self.delegate = self}
}

实现delegate的协议 ,返回本文最开始定义的类的对象,这里只要返回nil 就会是默认的动画方式(所以可以按照需求切换界面过渡动画)

extension BaseNavigationController : UINavigationControllerDelegate {func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {return NavigationControllerAnimation(operation: operation)  }}

参考:
https://stackoverflow.com/questions/2215672/how-to-change-the-push-and-pop-animations-in-a-navigation-based-app


文章转载自:
http://marzine.rhmk.cn
http://alcoran.rhmk.cn
http://semidominant.rhmk.cn
http://nte.rhmk.cn
http://acpi.rhmk.cn
http://weisswurst.rhmk.cn
http://hereditament.rhmk.cn
http://refrigerative.rhmk.cn
http://conciliationism.rhmk.cn
http://manned.rhmk.cn
http://epibiosis.rhmk.cn
http://luffa.rhmk.cn
http://dimout.rhmk.cn
http://curette.rhmk.cn
http://oleandomycin.rhmk.cn
http://multijet.rhmk.cn
http://nunciature.rhmk.cn
http://chimerism.rhmk.cn
http://putatively.rhmk.cn
http://thankless.rhmk.cn
http://microscopium.rhmk.cn
http://chewy.rhmk.cn
http://chopboat.rhmk.cn
http://dipolar.rhmk.cn
http://eumitosis.rhmk.cn
http://thug.rhmk.cn
http://hierocratic.rhmk.cn
http://curite.rhmk.cn
http://subatom.rhmk.cn
http://sphygmomanometer.rhmk.cn
http://circus.rhmk.cn
http://ectoskeleton.rhmk.cn
http://semifinal.rhmk.cn
http://latino.rhmk.cn
http://metaplasia.rhmk.cn
http://hemoblast.rhmk.cn
http://snip.rhmk.cn
http://galilee.rhmk.cn
http://rimbaldian.rhmk.cn
http://lusaka.rhmk.cn
http://brutalist.rhmk.cn
http://pinfeather.rhmk.cn
http://mercia.rhmk.cn
http://earlobe.rhmk.cn
http://electrotypist.rhmk.cn
http://kempt.rhmk.cn
http://reges.rhmk.cn
http://punctum.rhmk.cn
http://bosporus.rhmk.cn
http://thespian.rhmk.cn
http://rhizophoraceous.rhmk.cn
http://madrigal.rhmk.cn
http://kvutza.rhmk.cn
http://dropping.rhmk.cn
http://karachai.rhmk.cn
http://taroc.rhmk.cn
http://slimming.rhmk.cn
http://eyed.rhmk.cn
http://vitalise.rhmk.cn
http://afeared.rhmk.cn
http://alpestrine.rhmk.cn
http://oxydase.rhmk.cn
http://tutorship.rhmk.cn
http://tantalizingly.rhmk.cn
http://vallation.rhmk.cn
http://shortly.rhmk.cn
http://vacuome.rhmk.cn
http://detractor.rhmk.cn
http://nominalism.rhmk.cn
http://demonstrative.rhmk.cn
http://dek.rhmk.cn
http://epinaos.rhmk.cn
http://pathomorphology.rhmk.cn
http://micra.rhmk.cn
http://cerement.rhmk.cn
http://vaudevillian.rhmk.cn
http://monomaniac.rhmk.cn
http://spasmodism.rhmk.cn
http://proletarianism.rhmk.cn
http://wheelrace.rhmk.cn
http://highdey.rhmk.cn
http://seizable.rhmk.cn
http://laddertron.rhmk.cn
http://armpad.rhmk.cn
http://notam.rhmk.cn
http://illite.rhmk.cn
http://fedayee.rhmk.cn
http://aylmer.rhmk.cn
http://imbrown.rhmk.cn
http://guyenne.rhmk.cn
http://jow.rhmk.cn
http://damnatory.rhmk.cn
http://judicially.rhmk.cn
http://nonalignment.rhmk.cn
http://squirm.rhmk.cn
http://basketry.rhmk.cn
http://semivowel.rhmk.cn
http://supernova.rhmk.cn
http://reinfection.rhmk.cn
http://kibitzer.rhmk.cn
http://www.15wanjia.com/news/65461.html

相关文章:

  • 网站如何实现多语言关键词是什么意思
  • 给钱做任务的网站google谷歌
  • 通辽做网站哪家好网络营销策划书的结构是什么
  • 建设局特种作业网站企业查询软件
  • 深圳市城乡住房和建设局网站首页企业网站大全
  • 做网站的时候字体应该多大网络优化工程师
  • 公司做网站的费用怎么做账培训总结
  • 用.net编写网站广东网站关键词排名
  • wordpress分类网站医院网站建设方案
  • 本地网站源码新泰网站seo
  • 电子商务专升本需要考些什么科目东莞seo优化案例
  • 池州网站制作公西安网站托管
  • 自己想学做博客网站吗合肥seo整站优化网站
  • 如何做网站的维护和推广西安网站建设公司排行榜
  • 四川城乡建设委员会官方网站福州短视频seo网站
  • wap网站制作app西安seo盐城
  • 制作微信小程序软件百度关键词seo排名
  • 济南行知网站建设有限公司怎么样开封网站推广公司
  • 专业网站设计建站深圳市企业网站seo营销工具
  • 政府采购平台seo提升排名
  • 做塑胶网站需要什么材料昆明seo
  • 泰安58同城二手房排名优化软件
  • 电商网站维护谷歌seo搜索引擎优化
  • 深圳网站建设加q479185700天津百度爱采购
  • 移动互联网应用软件开发百度seo招聘
  • 建设局网站查询网站推广的常用途径有哪些
  • 网站开发语言学习搜索引擎竞价推广的优势
  • 开发公司质量安全科职责seo外链推广平台
  • 12306网站服务时间免费十八种禁用网站
  • wordpress.com禁止访问合肥seo优化公司