0

我正在使用 MMDrawer,我看到在更改多任务处理的大小时,我的侧边栏视图被完全遮蔽或根本没有遮蔽。

有没有办法解决这个问题?

4

1 回答 1

0

我在这里搜索并找到了一个可行的解决方案。

所以我在我的 MMDrawerController.m 文件中添加了以下代码:

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
    // willRotateToInterfaceOrientation code goes here
    BOOL gestureInProgress = NO;

    for (UIGestureRecognizer *gesture in self.view.gestureRecognizers) {
        if (gesture.state == UIGestureRecognizerStateChanged) {
            [gesture setEnabled:NO];
            [gesture setEnabled:YES];
            gestureInProgress = YES;
        }

        if (gestureInProgress) {
            [self resetDrawerVisualStateForDrawerSide:self.openSide];
        }
    }

    [coordinator animateAlongsideTransition:^(id < UIViewControllerTransitionCoordinatorContext > context) {
                 // willAnimateRotationToInterfaceOrientation code goes here
                 [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];

                 if (self.showsShadow) {
                     CGPathRef oldShadowPath = self.centerContainerView.layer.shadowPath;

                 if (oldShadowPath) {
                     CFRetain(oldShadowPath);
                 }

                 [self updateShadowForCenterView];

                 if (oldShadowPath) {
                     [self.centerContainerView.layer addAnimation:((^{
                         CABasicAnimation *transition = [CABasicAnimation animationWithKeyPath:@"shadowPath"];
                         transition.fromValue = (__bridge id)oldShadowPath;
                         transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
                         return transition;
                 })())
                       forKey:@"transition"];
                         CFRelease(oldShadowPath);
                     }
                 }
             }
             completion:nil];
}
于 2015-10-24T01:24:25.427 回答