Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

直接放在viewDidLoad里面是弹不出来的 #21

Open
Jean1992 opened this issue Aug 19, 2019 · 8 comments
Open

直接放在viewDidLoad里面是弹不出来的 #21

Jean1992 opened this issue Aug 19, 2019 · 8 comments

Comments

@Jean1992
Copy link

delay个0.5秒之后present就可以,但是系统的UIAlertViewController则没这个bug,本想用这个库替换整个项目里面的原生alert,但是很多地方都在didLoad里面做的弹窗。。。

@Jean1992
Copy link
Author

望修复

@Jean1992
Copy link
Author

弹不出来的原因是,SPAlertViewController的view的frame是{0,0,0,0}

@SPStore
Copy link
Owner

SPStore commented Aug 20, 2019 via email

@SPStore
Copy link
Owner

SPStore commented Aug 20, 2019 via email

@Jean1992
Copy link
Author

- (void)viewDidLoad {
    [super viewDidLoad];
    
    SPAlertController *sc = [SPAlertController alertControllerWithCustomAlertView:({ UIView *view = UIView.new; view.size = (CGSize){200,200}; view.backgroundColor = UIColor.whiteColor; view; }) 
    preferredStyle:SPAlertControllerStyleAlert animationType:SPAlertAnimationTypeExpand];
    [sc setBackgroundViewAppearanceStyle:SPBackgroundViewAppearanceStyleBlurDark alpha:1];
    [sc setTapBackgroundViewDismiss:NO];
    [self presentViewController:sc animated:YES completion:nil];
}

以上是代码,可以复制直接跑。。。

还有个问题,两个SPAlertController(简称sa)按顺序弹出,第一个没有dismiss掉的情况下,会自动dismiss掉,只剩下第二个。
或者一个sa先弹出,然后一个ua(原生那个)弹出,sp也会dismiss掉。
原生ua那个是将前面的隐藏起来,每操作掉一个,前一个就会重新冒出来。

@SPStore
Copy link
Owner

SPStore commented Aug 20, 2019 via email

@SPStore
Copy link
Owner

SPStore commented Aug 20, 2019 via email

@SPStore
Copy link
Owner

SPStore commented Aug 20, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants