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

Alert show in view #35

Open
ZenonHuang opened this issue Jan 12, 2019 · 3 comments
Open

Alert show in view #35

ZenonHuang opened this issue Jan 12, 2019 · 3 comments

Comments

@ZenonHuang
Copy link

能否支持把 Alert 放在 view / window 上?

目前有这样的场景:

当 A (自定义的view 添加在 window 上) 弹出,再调用 TBAlertController ,会被 A 给挡住。

@yulingtianxia
Copy link
Owner

yulingtianxia commented Jan 12, 2019

@ZenonHuang TBAlertController 只是将系统不同版本的 API 封装了下,相当于是适配器,所以没有额外做诸如添加 window 的特殊逻辑。(PS: 试了下系统的 UIAlertController 也是这样)
因为 AlertController 是建立在 VC 层面的,所以 present 的时候也需要注意层级。你可以试试在 A 的 window 的 vc 上 present 出来?

@ZenonHuang
Copy link
Author

ZenonHuang commented Jan 12, 2019

试过了,还是一样。
业务场景大部分 view 都是全屏 add 在 keyWindow 上。
尝试在 keyWindow.rootViewController 进行 present ,也无法解决。

TBActionSheet 能支持 Alert 风格吗?使用者可以自己定义 customView 。

@yulingtianxia
Copy link
Owner

yulingtianxia commented Jan 12, 2019

@ZenonHuang TBActionSheet 可以通过配置参数变成 AlertView。比如调整 offsetY 使其居中;使用自定义动画 show 和 close;禁用 backgroundTouchClosureEnabled。。。等等

不过目前我还没这么试过。

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