【求助】Android虚拟返回键退出程序(进程不杀掉),再次进入任意界面的点击事件都无效果



  • 监听虚拟返回键代码

    onBackHandler = () => {
        const routers = this.navigator.getCurrentRoutes();
        if (routers.length > 1) {
            this.navigator.pop();
            return true;
        }
        let now = new Date().getTime();
        if (now - lastClickTime < 2000) {
            BackHandler.exitApp();
            return false;
        }
        lastClickTime = now;
        Toast.show('再按一次退出程序');
        return true;
    }
    

    tab标签页用的是ScrollableTabView代码如下

      <ScrollableTabView
                tabBarPosition="bottom"
                locked={true}
                scrollWithoutAnimation={true}
                prerenderingSiblingsNumber={4}
                overlayBottom={true}
                renderTabBar={() => <TabBar
                    tabIconNames={tabIcon}
                    selectedTabIconNames={tabSelectedIcon}/>}>
                <GameContainer style={styles.subView}/>
                <NewsContainer style={styles.subView}/>
                <CommunityContainer style={styles.subView}/>
                <DataContainer style={styles.subView}/>
            </ScrollableTabView>
    

    请大佬指导。。。


Log in to reply