Open iTofu opened 7 years ago
I want to dim the centerController view while drawer is open in MMDrawerController with gradient effect, I do this:
UIView *blurView = [[UIView alloc] init]; blurView.backgroundColor = [UIColor blackColor]; [self.drawerController setDrawerVisualStateBlock:^(MMDrawerController *drawerController, MMDrawerSide drawerSide, CGFloat percentVisible) { NSLog(@"%f", percentVisible); blurView.alpha = 0.5f * percentVisible; if (percentVisible > 0 && !blurView.superview) { [drawerController.centerViewController.view addSubview:blurView]; [blurView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(drawerController.centerViewController.view); }]; } if (percentVisible == 0) { [blurView removeFromSuperview]; } }];
But I found percentVisible just jump to 0 or 1 if my finger left screen, not like: 0.50 -> 0.49 -> 0.48 ... -> 0.01 - 0?
Any advise?
I want to dim the centerController view while drawer is open in MMDrawerController with gradient effect, I do this:
But I found percentVisible just jump to 0 or 1 if my finger left screen, not like: 0.50 -> 0.49 -> 0.48 ... -> 0.01 - 0?