lixiang1994 / LEEAlert

优雅的可自定义 Alert ActionSheet
MIT License
1.29k stars 203 forks source link

[LEEAlert alert].config弹出的自定义视图,怎么调整垂直方向的距离? #162

Closed wyk190576528 closed 2 years ago

wyk190576528 commented 2 years ago

[LEEAlert alert].config .LeeIdentifier(@"vistorAlertView") .LeeStatusBarStyle(self.gk_statusBarStyle) .LeeConfigMaxWidth(^CGFloat(LEEScreenOrientationType type, CGSize size) { return size.width; }) .LeeShouldAutorotate(NO) .LeeBackGroundColor([UIColor blackColor]) .LeeBackgroundStyleTranslucent(0.35f) .LeeCustomView(self.vistorAlertView) .LeeHeaderInsets(UIEdgeInsetsMake(0, 0, 0, 0)) .LeeHeaderColor([UIColor clearColor]) .LeeOpenAnimationConfig(^(void (^ _Nonnull animatingBlock)(void), void (^ _Nonnull animatedBlock)(void)) { self.vistorAlertView.alpha = 0.2; self.vistorAlertView.transform = CGAffineTransformScale(self.vistorAlertView.transform,0.8,0.8); [UIView animateWithDuration:0.5f delay:0 usingSpringWithDamping:0.7 initialSpringVelocity:1.0f options:UIViewAnimationOptionAllowUserInteraction animations:^{ animatingBlock(); //调用动画中Block self.vistorAlertView.transform = CGAffineTransformIdentity; self.vistorAlertView.alpha = 1; } completion:^(BOOL finished) { animatedBlock(); //调用动画结束Block }]; }) .LeeCloseAnimationConfig(^(void (^ _Nonnull animatingBlock)(void), void (^ _Nonnull animatedBlock)(void)) { [UIView animateWithDuration:0.25f delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ animatingBlock(); self.vistorAlertView.alpha = 0; self.vistorAlertView.transform = CGAffineTransformScale(self.vistorAlertView.transform, 0.5, 0.5);

    } completion:^(BOOL finished) {
        animatedBlock();
        [self.vistorAlertView removeFromSuperview];
        self.vistorAlertView = nil;
    }];
})
.LeeShow();

效果如下: Simulator Screen Shot - iPhone 13 - 2021-12-22 at 16 04 08 怎么设置,可以让视图下移紧贴屏幕底部?

lixiang1994 commented 2 years ago

垂直是根据 self.vistorAlertView 高度来撑的