Created
July 27, 2022 07:21
-
-
Save hanfengs/7607e27eb902774e9f282ac53ddab8d0 to your computer and use it in GitHub Desktop.
[优惠券弹框]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 根据接口是否显示优惠券弹框 | |
[self showCouponAlertView]; | |
#pragma mark- 优惠弹框 | |
- (void)showCouponAlertView { | |
UIView *contentView = [[UIView alloc] initWithFrame:CGRectZero]; | |
contentView.backgroundColor = UIColorRed; | |
QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init]; | |
modalViewController.contentView = contentView; | |
modalViewController.modal = NO; | |
modalViewController.layoutBlock = ^(CGRect containerBounds, CGFloat keyboardHeight, CGRect contentViewDefaultFrame) { | |
CGFloat width = 270; | |
CGFloat height = 100; | |
contentView.qmui_frameApplyTransform = CGRectMake((CGRectGetWidth(containerBounds)-width)/2, (CGRectGetHeight(containerBounds)-height)/2, width, height); | |
}; | |
[modalViewController showWithAnimated:YES completion:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment