作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 WizarDroid,如果满足某些条件,我打算跳过一个步骤。
我有以下流程:
flow = new WizardFlow.Builder()
.setActivity(this) //First, set the hosting activity for the wizard
.setContainerId(R.id.step_container) //then set the layout container for the steps.
.addStep(WStep1.class) //Add your steps in the order you want them
.addStep(WStep2.class) //to appear and eventually call create()
.addStep(WStep3.class) //to create the wizard flow.
.create();
如果设置了变量,我打算跳过 WStep2。
根据它的教程,我只能禁用前进到下一步,直到我这样设置:Controlling wizard flow dynamically
如何告诉向导可以跳过下一步?
最佳答案
WizarDroid 似乎没有提供从 WizardFlow 中删除步骤的功能。
但是,您可以检查您在 WStep2
中提到的那个变量,然后调用 goNext()
。这肯定会奏效。
如果你想尝试另一种方式,你也可以使用(虽然我不能保证它会起作用):
setStepCompleted(1, true) //setStepCompleted(int stepPosition, boolean stepCompleted)
编辑:看到你也想在向导中倒退,你将不得不拆分向导。
我的意思是,如果您想在某些情况下跳过 WStep3:
在你的 MainActivity.class 中
flow1 = new WizardFlow.Builder()
.setActivity(this)
.setContainerId(R.id.step_container)
.addStep(WStep1.class)
.addStep(WStep2.class)
.create();
在 WStep2.class 中
if (skipWStep3()){
flow2 = new WizardFlow.Builder()
.setActivity(this)
.setContainerId(R.id.step_container)
.addStep(WStep4.class)
.addStep(WStep5.class)
.create();
}
else {
flow2 = new WizardFlow.Builder()
.setActivity(this)
.setContainerId(R.id.step_container)
.addStep(WStep3.class)
.addStep(WStep4.class)
.addStep(WStep5.class)
.create();
}
关于android - 如何在 WizarDroid 中跳过 WizardStep,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24822966/
我使用 WizarDroid,如果满足某些条件,我打算跳过一个步骤。 我有以下流程: flow = new WizardFlow.Builder() .setActivity(this)
我是一名优秀的程序员,十分优秀!