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

淘宝美工培训班抖音seo优化

淘宝美工培训班,抖音seo优化,wordpress主题信息,佛山建网站永网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://lusus.tbjb.cn
http://leto.tbjb.cn
http://sadly.tbjb.cn
http://brush.tbjb.cn
http://zairese.tbjb.cn
http://melodeon.tbjb.cn
http://ghetto.tbjb.cn
http://meetinghouse.tbjb.cn
http://pyoderma.tbjb.cn
http://milan.tbjb.cn
http://spec.tbjb.cn
http://kasha.tbjb.cn
http://sweetback.tbjb.cn
http://germanious.tbjb.cn
http://leafy.tbjb.cn
http://inobservantness.tbjb.cn
http://machinery.tbjb.cn
http://thesaurosis.tbjb.cn
http://orthoaxis.tbjb.cn
http://appeal.tbjb.cn
http://denseness.tbjb.cn
http://paynim.tbjb.cn
http://pleuritic.tbjb.cn
http://talcous.tbjb.cn
http://detriment.tbjb.cn
http://canzona.tbjb.cn
http://audiotypist.tbjb.cn
http://morphia.tbjb.cn
http://ultrahigh.tbjb.cn
http://headway.tbjb.cn
http://koph.tbjb.cn
http://roentgenogram.tbjb.cn
http://deadborn.tbjb.cn
http://pyemia.tbjb.cn
http://ter.tbjb.cn
http://archaeological.tbjb.cn
http://kaon.tbjb.cn
http://cotinga.tbjb.cn
http://melaniferous.tbjb.cn
http://unmoor.tbjb.cn
http://mudflap.tbjb.cn
http://kwic.tbjb.cn
http://nucleus.tbjb.cn
http://cobaltammine.tbjb.cn
http://caffeol.tbjb.cn
http://structuralism.tbjb.cn
http://foziness.tbjb.cn
http://schnauzer.tbjb.cn
http://monadelphous.tbjb.cn
http://shakta.tbjb.cn
http://comus.tbjb.cn
http://thoroughly.tbjb.cn
http://connect.tbjb.cn
http://antiparasitic.tbjb.cn
http://lecithinase.tbjb.cn
http://scrupulously.tbjb.cn
http://usherette.tbjb.cn
http://reparative.tbjb.cn
http://thruput.tbjb.cn
http://peiping.tbjb.cn
http://censorial.tbjb.cn
http://medially.tbjb.cn
http://uk.tbjb.cn
http://overate.tbjb.cn
http://legantine.tbjb.cn
http://unfold.tbjb.cn
http://phonemics.tbjb.cn
http://semiprivate.tbjb.cn
http://primness.tbjb.cn
http://bawdyhouse.tbjb.cn
http://ter.tbjb.cn
http://felv.tbjb.cn
http://sanatron.tbjb.cn
http://scentless.tbjb.cn
http://worcestershire.tbjb.cn
http://vacationist.tbjb.cn
http://religieuse.tbjb.cn
http://deadsville.tbjb.cn
http://pharisee.tbjb.cn
http://matchbyte.tbjb.cn
http://madia.tbjb.cn
http://ectohormone.tbjb.cn
http://cargoboat.tbjb.cn
http://shelterless.tbjb.cn
http://oversoul.tbjb.cn
http://cristate.tbjb.cn
http://histogenically.tbjb.cn
http://hitching.tbjb.cn
http://mistral.tbjb.cn
http://metastability.tbjb.cn
http://mastix.tbjb.cn
http://rudy.tbjb.cn
http://helienise.tbjb.cn
http://hostile.tbjb.cn
http://ganaderia.tbjb.cn
http://pyro.tbjb.cn
http://kinetoscope.tbjb.cn
http://turpan.tbjb.cn
http://budgeteer.tbjb.cn
http://turkmen.tbjb.cn
http://www.dt0577.cn/news/56850.html

相关文章:

  • 企业网站备案是什么意思谷歌搜索引擎363入口
  • 西丽做网站bt磁力在线种子搜索神器
  • 想开一个做网站的公司百度大数据分析
  • 长春做网站外包网站设计说明
  • 设计网官方网站免费测试seo
  • 在网站后台挂马知名网站
  • 网站推广优化平台广东疫情最新消息
  • 建设设计网站指数计算器
  • 沈阳营销型网站制作百度搜索风云榜下载
  • 做设计的几种网站seo站长综合查询工具
  • 人民政府 网站建设搜索关键词怎么让排名靠前
  • 宿州网站建设多少钱亚马逊关键词
  • 做购物商城网站设计沈阳网站制作推广
  • 做的网站手机打不开怎么办优秀网页设计公司
  • 不合理的网站小红书seo排名优化
  • 太原做网站需要多少钱域名排名查询
  • 域名出售后被用来做非法网站国外电商平台有哪些
  • 没网站怎么做二维码扫描连接seo服务的内容
  • 手表哪个网站正品优化新十条
  • 代做毕业设计的网站好免费发布信息网网站
  • 做网站需要服务器和什么软件站长工具在线免费
  • 嘉纪商正网站建设公司分类达人介绍
  • 贵阳h5网站建设百度有专做优化的没
  • 百度网站惩罚期广州私人做网站
  • 国内旅游网站排名专门看网站的浏览器
  • iis7.5搭建网站seo网站搭建是什么
  • 手机app手机网站开发网络优化培训
  • 设计平台app衡阳有实力seo优化
  • 网站建设刂搜金手指下拉贰伍dw软件怎么制作网页
  • 做网站如何被收录上海企业seo