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

在不同控制器中显示弹框的时候,能显示多个吗? #158

Open
heyehao2008 opened this issue Oct 21, 2021 · 7 comments
Open

Comments

@heyehao2008
Copy link

A,B,C控制器共同拥有一个导航栏NavConroller,我想在A显示一个弹框,点击后push到B,然后到C,C也显示一个弹框。
直接显示,然后在C把弹框消失,A上的弹框也消失了。能共存吗?弹框是加到导航栏NavConroller上的

@lixiang1994
Copy link
Owner

共存? 同时有两个弹窗显示吗?

@heyehao2008
Copy link
Author

共存? 同时有两个弹窗显示吗?

一个页面还是只有一个弹框,只是C页面的弹框显示后消失,不影响A页面的弹框显示消失。
现在的情况是,C页面弹框展示消失后,A页面的弹框也消失了,给每个弹框设置了identifer也没用。

@lixiang1994
Copy link
Owner

懂了, 目前的机制是不支持的, 有个曲线救国的办法就是A页面appear的时候再调用显示 这么写有点恶心.. 还有一种常规的写法可以实现就是你的弹窗用子视图或者子控制器的形式去写, 这样A页面就不用管它了 pop回来依旧在

@heyehao2008
Copy link
Author

“还有一种常规的写法可以实现就是你的弹窗用子视图或者子控制器的形式去写, 这样A页面就不用管它了 pop回来依旧在”
使用该库,将每个弹框都加在A,C控制器上,而不是加在AC页面的导航栏控制器上,可以实现共存吗?
还是说该库目前的机制是不支持这样操作的

@lixiang1994
Copy link
Owner

当前所有弹窗的controller是同一个, 也就是说只能同时显示一个弹窗, 不能同时显示多个, 弹窗的controller是通过set不同config来进行内容的切换, 通过一个队列来进行多个config的管理, 所以还无法做到你说的A页面一个弹窗同时C页面一个弹窗.

@heyehao2008
Copy link
Author

哦,好的,懂了,谢谢!想办法曲线救国

@szmichaelyb
Copy link

szmichaelyb commented Dec 13, 2021

@heyehao2008

从 A ---> C,其实已经进行了视图切换,所以,可以在 A push 到B时,先让 A 的弹窗消失。同样,从C ---> B ---> A,再将 A 弹窗显示出来。也就是多了个触发 弹出窗的位置而已,我认为,可以不必纠结 能否让它一直展示吧。

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

3 participants