yulingtianxia / TBActionSheet

A Custom&Powerful Action Sheet For iOS. 一个 ActionSheet 满足所有样式!超高自由度的可定制!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alert show in view

ZenonHuang opened this issue · comments

commented

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

目前有这样的场景:

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

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

commented

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

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

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

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