在标签之间滑动

时间:2016-01-05 11:48:07

标签: ios swift animation uitabbarcontroller

如何使用tabBarController进行并排转换。就像一个正常的" ScrollView分页。

像这样:enter image description here

目前我正在使用CrossDissolve:

class TransitioningObject: NSObject, UIViewControllerAnimatedTransitioning {

  func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
    let fromView: UIView = transitionContext.viewForKey(UITransitionContextFromViewKey)!
    let toView: UIView = transitionContext.viewForKey(UITransitionContextToViewKey)!

    transitionContext.containerView()!.addSubview(fromView)
    transitionContext.containerView()!.addSubview(toView)

    UIView.transitionFromView(fromView, toView: toView, duration: transitionDuration(transitionContext), options: UIViewAnimationOptions.TransitionCrossDissolve) { finished in
        transitionContext.completeTransition(true)
    }
  }

  func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval {
    return 0.25
  }
}

作为并排转换的扩展,我想在选项卡self.view上添加一个滑动手势。但那是后来的问题,现在我需要找出如何进行转换。

0 个答案:

没有答案