bytedance/scene

关于拦截Pop动作的问题

Iridescentangle opened this issue · 2 comments

项目结构是主页BottomNavigationView配合几个Scene切换,所以按照Demo中的拦截Pop页面加入了
image

但是在这个页面同级的其他Scene中也会响应该返回事件

qii commented

可以在回调里面判断当前Scene是不是可见

if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {

                    } else {
                        return false;
                    }

最初设计的时候,是一定要可见才能拦截,后来改坏了……就一直没修……因为觉得补一段if else就没事了……

if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {

                    } else {
                        return false;
                    }

好的