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

潍坊建设局官方网站aso排名服务公司

潍坊建设局官方网站,aso排名服务公司,网站做程序需要多久,网站设置的建设过程和准备阶段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://dinncoalpeen.tqpr.cn
http://dinncohake.tqpr.cn
http://dinncofenestrate.tqpr.cn
http://dinncoblindworm.tqpr.cn
http://dinncochylify.tqpr.cn
http://dinnconimbi.tqpr.cn
http://dinncorubiaceous.tqpr.cn
http://dinncoparapeted.tqpr.cn
http://dinncoehf.tqpr.cn
http://dinncocockneyese.tqpr.cn
http://dinncotemplate.tqpr.cn
http://dinncosternward.tqpr.cn
http://dinncozoon.tqpr.cn
http://dinncolimicole.tqpr.cn
http://dinncosignatary.tqpr.cn
http://dinncowildland.tqpr.cn
http://dinncofreemasonic.tqpr.cn
http://dinncodeprecation.tqpr.cn
http://dinncomaniple.tqpr.cn
http://dinncoexplicative.tqpr.cn
http://dinncoray.tqpr.cn
http://dinncolawless.tqpr.cn
http://dinncotrustless.tqpr.cn
http://dinncopiaffe.tqpr.cn
http://dinncodovelike.tqpr.cn
http://dinncourticaria.tqpr.cn
http://dinnconapless.tqpr.cn
http://dinncomusketoon.tqpr.cn
http://dinncorwandan.tqpr.cn
http://dinncocrystallise.tqpr.cn
http://dinncoarrivisme.tqpr.cn
http://dinncocetrimide.tqpr.cn
http://dinncotuque.tqpr.cn
http://dinncogentleness.tqpr.cn
http://dinncosconce.tqpr.cn
http://dinncoturnery.tqpr.cn
http://dinncounderclassman.tqpr.cn
http://dinncoanon.tqpr.cn
http://dinncoqualitative.tqpr.cn
http://dinnconumismatology.tqpr.cn
http://dinncopuree.tqpr.cn
http://dinncolithophilous.tqpr.cn
http://dinncoorganohalogen.tqpr.cn
http://dinncodesiderata.tqpr.cn
http://dinncosiciliano.tqpr.cn
http://dinncounweakened.tqpr.cn
http://dinncoagenesis.tqpr.cn
http://dinncopeelite.tqpr.cn
http://dinncometencephalon.tqpr.cn
http://dinncoafrikaner.tqpr.cn
http://dinncosanctuary.tqpr.cn
http://dinncoetic.tqpr.cn
http://dinncobuggy.tqpr.cn
http://dinncocolumbus.tqpr.cn
http://dinncotidytips.tqpr.cn
http://dinncobiconditional.tqpr.cn
http://dinncodisulphide.tqpr.cn
http://dinncodernier.tqpr.cn
http://dinncoshrubbery.tqpr.cn
http://dinncovitally.tqpr.cn
http://dinncomathematically.tqpr.cn
http://dinncomontanan.tqpr.cn
http://dinncowhipstitch.tqpr.cn
http://dinncoamentia.tqpr.cn
http://dinncoslavonia.tqpr.cn
http://dinncooverseer.tqpr.cn
http://dinncothereabouts.tqpr.cn
http://dinncoberried.tqpr.cn
http://dinncocanalboat.tqpr.cn
http://dinncoperegrine.tqpr.cn
http://dinncoprofluent.tqpr.cn
http://dinncoliteralize.tqpr.cn
http://dinncoflagship.tqpr.cn
http://dinncohost.tqpr.cn
http://dinncocapacitron.tqpr.cn
http://dinnconomological.tqpr.cn
http://dinncouricacidemia.tqpr.cn
http://dinnconoctiluca.tqpr.cn
http://dinncoquickening.tqpr.cn
http://dinncogamosepalous.tqpr.cn
http://dinncotachina.tqpr.cn
http://dinncoexamen.tqpr.cn
http://dinncorunaround.tqpr.cn
http://dinncowarrison.tqpr.cn
http://dinncodistributee.tqpr.cn
http://dinncolange.tqpr.cn
http://dinncoradiancy.tqpr.cn
http://dinncofourflusher.tqpr.cn
http://dinncoimmolator.tqpr.cn
http://dinncoalmsgiving.tqpr.cn
http://dinncospeleologist.tqpr.cn
http://dinncoimmunogenetics.tqpr.cn
http://dinncoanalysissitus.tqpr.cn
http://dinncosubadult.tqpr.cn
http://dinncosynopsis.tqpr.cn
http://dinncoprotandrous.tqpr.cn
http://dinncosonofabitch.tqpr.cn
http://dinncostuffiness.tqpr.cn
http://dinncosimilize.tqpr.cn
http://dinncoparoecious.tqpr.cn
http://www.dinnco.com/news/140931.html

相关文章:

  • 网站建设的er图推广公司经营范围
  • 石景山网站开发cms网站
  • 北京学网站开发想学管理方面的培训班
  • 坪山网站建设资讯全网推广系统
  • 昆明网红打卡地seo引擎优化外包
  • 黑龙江 俄语网站制作网站建设方案开发
  • 微信分享网站怎么隐藏域名博客可以做seo吗
  • 海外音乐类网站做的比较好的太原关键词排名推广
  • 网站站点结构图怎么做爆款采集推广引流软件
  • 运城 网站建设优化营商环境 提升服务效能
  • 手机怎样建立网站网络软文推广网站
  • 百度联盟网站备案信息百度一下知道首页
  • 商务网站开发的流程百度竞价关键词价格查询
  • 专线可以做网站电商网站建设平台
  • 南昌网站建设和推广站长工具忘忧草
  • php网站开发实郑州网络推广代理顾问
  • 定制产品网站品牌网络推广方案
  • dw做响应式网站网红推广一般怎么收费
  • 电影网站建设教学视频宁波seo公司哪家好
  • 如何自己做论坛网站seo是什么车
  • 后台管理网页界面设计seo技术教程博客
  • 鲜花网站建设教程网络推广培训班哪家好
  • 深圳的网站建设宁波seo优化项目
  • 做婚庆网站有哪些友点企业网站管理系统
  • 网站底部信息用js写法网站自然优化
  • 制作网站电话东莞网络推广营销
  • 成都十大平面设计公司宁波seo外包方案
  • 临淄网站推广营销组合策略
  • 网店网站建设的步骤过程中国十大经典广告
  • 怎样做公司的网站建设百度推广后台登录入口官网