弹性过渡效果适用于第二次和过渡后,但不适用于第一次过渡
我有一个灵活的应用程序,可以通过按钮切换在两种状态之间转换。我的问题是,淡入淡出的效果似乎只在第二次转换及之后起作用。然而,对于我的第一次转换...从 State1 到 StudyState...没有任何淡入淡出效果,事实上 state1 中的组件完全消失(页脚填充了“主体”原来所在的空白),然后Flex 重新创建了 StudyState(没有任何淡入淡出,仅在 StudyState 中用组件重新填充“主体”)。
然而,在第一次转换之后,在 StudyState 和 State1 之间工作完全正常。为什么会发生这种情况,我怎样才能做到这一点,以便交叉淡入淡出从第一个转换开始工作?请帮忙!
<s:transitions>
<s:Transition id="t1" autoReverse="true">
<s:CrossFade
target="{holder}"
duration="1500" />
</s:Transition>
</s:transitions>
<s:states>
<s:State name="State1" />
<s:State name="studyState" />
</s:states>
<s:VGroup id="globalGroup" includeIn="State1" width="100%">stuff</Vgroup>
<s:VGroup id="studyGroup" includeIn="studyState" width="100%">stuff</Vgroup>
i have a flex app that transitions between 2 states with the toggle of a button. my issue is that the effect of fading only seems to work on the 2nd transition and after. However, for my first transition... going from State1 to studyState... there is no fade effect whatsoever, in fact the components in state1 disappear completely (the footer fills the empty gap where the "body" use to be) and then the flex recreates the studyState (without any fade refilling the "body" with components only in studyState).
After this first transition however, going between studyState and State1 working COMPLETELY fine.. why does this happen and how can i make it so that crossfade works STARTING FROM THE VERY FIRST TRANSITION? please help!
<s:transitions>
<s:Transition id="t1" autoReverse="true">
<s:CrossFade
target="{holder}"
duration="1500" />
</s:Transition>
</s:transitions>
<s:states>
<s:State name="State1" />
<s:State name="studyState" />
</s:states>
<s:VGroup id="globalGroup" includeIn="State1" width="100%">stuff</Vgroup>
<s:VGroup id="studyGroup" includeIn="studyState" width="100%">stuff</Vgroup>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
状态转换有什么问题吗?您能提供完整的代码示例吗?
该代码段基本上按照我的预期工作:
What is wrong about the state transition? Can you provide a full code sample?
This code segment, basically, works as I would have expected: