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

湖南备案网站建设方案书10岁一12岁的创意手工

湖南备案网站建设方案书,10岁一12岁的创意手工,深圳企业网站设,是怎么开的?UINavigationController内部页面跳转默认为左右切换#xff0c;但是当我们想向上弹出进入界面#xff0c;或者向下离开界面时#xff0c;需要实现UINavigationControllerDelegate 协议自行控制页面的动画(否则直接在navVc上叠加动画会导致动画结束后的那个页面#xff0c;自…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://www.hkea.cn/news/14567882/

相关文章:

  • 网站建设模块下载家装网站建设公司
  • 网站做微信支付成都房地产开发商排名
  • 要想做一个好网站需要多久仙游网站建设
  • 摄影网站开发背景怎么写上海近期大型招聘会
  • 青岛市住房和城乡建设局官方网站辽宁建设工程信息网新版网址
  • 京东商城网站特色wordpress 4.5下载地址
  • 网站开发三个流程什么是网络营销的技术
  • 服装网站模板商丘网站制作教程
  • 企业网站建设 租用服务器软件开发需要具备什么条件
  • 没有ipc备案的网站建设电子商务网站总结
  • 网站开发的发展历史及趋势网站开发国内外现状研究
  • 工作号做文案素材的网站装饰设计乙级资质
  • 免费建设个人网站阳光家园广州网站
  • 哈尔滨网站建设工作室怎么在手机上设计网站
  • 阿尔山网站建设wordpress修改为中文
  • h5网站开发定制wordpress分类下的所有文章加密
  • 浙江建设人才网做360优化网站都有哪家
  • 网站群建设公司利用c 做网站
  • 宜宾市住房和城乡建设局网站网站页面优化公告
  • 网站建设字体颜色代码制作html网站模板
  • 做网站专题的效果如何创建自己的域名
  • 椒江网站制作什么企业时候做网站
  • 基于.net音乐网站开发app拉新推广代理
  • 牛商网做网站要多少钱wordpress js 太多
  • 电商网站建设系统注册免费
  • 免费外贸网站在线网站点赞怎么做
  • 怎么在阿里巴巴做网站网页画图工具
  • 网站建设上怎么优化自己的网站
  • 给县里做网站网站大学报名官网入口
  • 大连网站建设领超最好导航网站开发