• <small id='380wQ'></small><noframes id='380wQ'>

    1. <tfoot id='380wQ'></tfoot>
          <bdo id='380wQ'></bdo><ul id='380wQ'></ul>
        <i id='380wQ'><tr id='380wQ'><dt id='380wQ'><q id='380wQ'><span id='380wQ'><b id='380wQ'><form id='380wQ'><ins id='380wQ'></ins><ul id='380wQ'></ul><sub id='380wQ'></sub></form><legend id='380wQ'></legend><bdo id='380wQ'><pre id='380wQ'><center id='380wQ'></center></pre></bdo></b><th id='380wQ'></th></span></q></dt></tr></i><div id='380wQ'><tfoot id='380wQ'></tfoot><dl id='380wQ'><fieldset id='380wQ'></fieldset></dl></div>

      1. <legend id='380wQ'><style id='380wQ'><dir id='380wQ'><q id='380wQ'></q></dir></style></legend>

        呈现后被 UITransitionView 阻止的视图

        View being blocked by UITransitionView after being presented(呈现后被 UITransitionView 阻止的视图)
      2. <i id='Jtqwu'><tr id='Jtqwu'><dt id='Jtqwu'><q id='Jtqwu'><span id='Jtqwu'><b id='Jtqwu'><form id='Jtqwu'><ins id='Jtqwu'></ins><ul id='Jtqwu'></ul><sub id='Jtqwu'></sub></form><legend id='Jtqwu'></legend><bdo id='Jtqwu'><pre id='Jtqwu'><center id='Jtqwu'></center></pre></bdo></b><th id='Jtqwu'></th></span></q></dt></tr></i><div id='Jtqwu'><tfoot id='Jtqwu'></tfoot><dl id='Jtqwu'><fieldset id='Jtqwu'></fieldset></dl></div>

            <bdo id='Jtqwu'></bdo><ul id='Jtqwu'></ul>
            <tfoot id='Jtqwu'></tfoot>

                    <tbody id='Jtqwu'></tbody>
                  <legend id='Jtqwu'><style id='Jtqwu'><dir id='Jtqwu'><q id='Jtqwu'></q></dir></style></legend>

                  <small id='Jtqwu'></small><noframes id='Jtqwu'>

                1. 本文介绍了呈现后被 UITransitionView 阻止的视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个侧面导航控制器并通过 UIButton 呈现它.当我通过 [self presentviewcontroller: NC animated: YES completion: nil] 直接将此 NC 设置为根视图控制器时,出于某种原因,NC 的菜单侧被 UITransitionView 我无法消失.

                  I have a side navigation controller and present it via a UIButton. When I make this NC the root view controller directly by [self presentviewcontroller: NC animated: YES completion: nil], some reason the menu side of the NC is blocked by a UITransitionView that I cannot get to disappear.

                  我附上了 . 是另一个.

                  I've attached an image of the . is another.

                  我尝试了以下方法:

                  UIWindow *window = [(AppDelegate *)[[UIApplication sharedApplication] delegate] window];
                      window.backgroundColor = kmain;
                  
                  
                      CATransition* transition = [CATransition animation];
                      transition.duration = .5;
                      transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
                      transition.type = kCATransitionPush;
                      transition.subtype = kCATransitionFromTop;
                  
                      [nc.view.layer addAnimation:transition forKey:kCATransition];
                  
                      [UIView transitionWithView:window
                                        duration:0.5
                                         options:UIViewAnimationOptionTransitionNone
                                      animations:^{ window.rootViewController = nc; }
                                      completion:^(BOOL finished) {
                                          for (UIView *subview in window.subviews) {
                                              if ([subview isKindOfClass:NSClassFromString(@"UITransitionView")]) {
                                                  [subview removeFromSuperview];
                                              }
                                          }
                                      }];
                  

                  但它非常hacky,并且随着窗口的rootviewcontroller在转换过程中发生变化,它有点波涛汹涌,导航控制器和右上角的一部分变黑了.看起来很糟糕.

                  But it is very hacky, and as the rootviewcontroller of the window changes during the transition, it's a little choppy and part of the navigationcontroller and the top right corner turn black. It looks very bad.

                  推荐答案

                  要通过UITransitionView获取点击事件,设置containerViewuserInteractionEnabledfalse.这是如果您正在使用 UIViewControllerAnimatedTransitioning 进行自定义过渡动画.

                  To get tap events through the UITransitionView, set the containerView's userInteractionEnabled to false. This is if you're doing a custom transition animation by using UIViewControllerAnimatedTransitioning.

                  例如,在您的 animateTransition(_:) 中:

                  func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
                  
                      let containerView = transitionContext.containerView
                      containerView.isUserInteractionEnabled = false
                  
                      ...
                  }
                  

                  这篇关于呈现后被 UITransitionView 阻止的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                  ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                  Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                  How to add a navigation controller programmatically in code but not as initial view controller(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                  How to get the previous viewcontroller that pushed my current view(如何获取推送我当前视图的上一个视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)

                  1. <small id='BibtP'></small><noframes id='BibtP'>

                    <i id='BibtP'><tr id='BibtP'><dt id='BibtP'><q id='BibtP'><span id='BibtP'><b id='BibtP'><form id='BibtP'><ins id='BibtP'></ins><ul id='BibtP'></ul><sub id='BibtP'></sub></form><legend id='BibtP'></legend><bdo id='BibtP'><pre id='BibtP'><center id='BibtP'></center></pre></bdo></b><th id='BibtP'></th></span></q></dt></tr></i><div id='BibtP'><tfoot id='BibtP'></tfoot><dl id='BibtP'><fieldset id='BibtP'></fieldset></dl></div>
                  2. <legend id='BibtP'><style id='BibtP'><dir id='BibtP'><q id='BibtP'></q></dir></style></legend>

                      • <bdo id='BibtP'></bdo><ul id='BibtP'></ul>
                        <tfoot id='BibtP'></tfoot>
                              <tbody id='BibtP'></tbody>