模态上的自定义android BackHandler

问题描述

我正在构建一个乘车共享应用程序,以学习对本机的反应。在我的full_linear_regression = ot.LinearModelAlgorithm(X,Y) full_linear_regression.run() full_linear_regression_result = full_linear_regression.getResult() full_linear_regression_analysis = ot.LinearModelAnalysis(full_linear_regression_result) View(full_linear_regression_analysis.drawModelVsFitted()) 上,我可以触发一个Main.js,该Modal包含7个条件渲染,用于所需乘骑信息的每个步骤。例如

 let screenStep;
    if (step===1){
        screenStep=<InsertScreen 
                    //some props
                />
    } if (step===2){
        screenStep=<InsertAnotherScreen
                   // some other props.
                    />
...
    };

但是,每当在模式中按下android的后处理程序时,showModal的状态就会从MainScreen变为false。相反,我希望有一个自定义的Android BackHandler。更具体地说:

 if (step===1){
    //Toggle shwoModal state to false,default backhandler
 } else if (step>1){
    //Toggle the function that triggers (step-1) to render the previous step
 }

如何在模式上自定义android backhandler?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...