|
@@ -24,7 +24,13 @@ static YRAlertView *alert = nil;
|
|
|
|
|
|
|
|
alert = [[YRAlertView alloc]initWithFrame:[UIScreen mainScreen].bounds];
|
|
alert = [[YRAlertView alloc]initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
|
|
|
|
|
|
+ alert.windowLevel = UIWindowLevelAlert;
|
|
|
|
|
+
|
|
|
alert.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2f];
|
|
alert.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2f];
|
|
|
|
|
+ //防止某些情况下没有主window异常
|
|
|
|
|
+ UIViewController *viewC = [UIViewController new];
|
|
|
|
|
+
|
|
|
|
|
+ alert.rootViewController = viewC;
|
|
|
|
|
|
|
|
[alert makeKeyAndVisible];
|
|
[alert makeKeyAndVisible];
|
|
|
|
|
|
|
@@ -126,7 +132,7 @@ static YRAlertView *alert = nil;
|
|
|
[centView addSubview:sure];
|
|
[centView addSubview:sure];
|
|
|
[sure addTarget:alert action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
|
|
[sure addTarget:alert action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
|
|
|
- if (cancelTitle) {
|
|
|
|
|
|
|
+ if (cancelTitle.length > 0) {
|
|
|
[centView addSubview:cancel];
|
|
[centView addSubview:cancel];
|
|
|
[cancel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
[cancel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|