在 flash builder 4 中进行与设计模式下的状态无关的更改
如果我有一个定义了某些状态的组件,是否有办法在设计模式中进行更改但不将其绑定到特定状态?例如,如果我有state1和state2,那么设计模式的任何更改都将基于state1或state2(即width.state1)。我知道这是 Flex 的发展方向,但我正在从 Flex 3 应用程序过渡,现在我只想更改宽度而不是 width.state1。
If I have a component that has some states defined, is there a way to make changes in design mode but not have it tied to a particular state? For example, if I have state1 and state2, any changes in design mode will be based on state1 or state2 (i.e. width.state1). I understand this is the direction Flex is going in but I'm transitioning from a Flex 3 app and right now I just want to make the change to width and not width.state1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是我不喜欢的 Flash Builder 的“功能”之一。如果您可以从“状态”下拉列表中选择
,那也不错,但无论出于何种原因,这都不是一个选项。据我所知,没有办法在不影响特定状态的情况下使用设计模式。我会采纳 J_A_X 的建议,并在源代码模式下自己编写代码。
编辑:Flextras 添加了一个很好的示例,说明如何为特定状态或所有状态编码属性。
This is one of the "features" of Flash Builder that I'm not a fan of. It wouldn't be so bad if you could select
<base state>
from the State drop down list but for whatever reason, that's not an option.As far as I know, there's no way to use design mode without affecting a specific state. I would go with J_A_X's suggestion and just code it yourself in Source mode.
EDIT: Flextras added a good example of how to code properties for a specific state or for all states as well.
我不知道如何在设计模式下做到这一点,但在 MXML 中你有这样的事情:
如果你想设置一个不与状态绑定的宽度,请执行以下操作:
另外,我不确定我是否' d 对 Flex 的发展方向做出任何笼统的陈述。迄今为止,Adobe 已多次改变方向。构建移动皮肤时;他们建议不要完全使用 MXML;对于移动皮肤中的性能状态,是代码中的硬编码更改。
I'm not sure how to do it in design mode, but in MXML you have something like this:
If you want to just set a width that is not tied to a state, do this:
Also, I'm unsure if I'd make any blanket statements on the direction Flex is going. To date Adobe has changed directions a few times. When building Mobile Skins; they recommend against using MXML completely; and for performance states in mobile skins are hard-coded changes in the code.
有一种方法可以强制属性独立于视图状态:在选择相关组件的设计窗口中单击鼠标右键,然后选择上下文菜单中的最后一个选项“将当前属性应用于所有状态”。不过,该选项并不真正灵活:它将删除您为该组件设置的所有视图相关属性。还要注意您选择的组件。如果您的鼠标指针不在正确的位置,则在设计窗口中右键单击将选择不同的组件。
There is one way to force the properties to be independent of the view state : right mouse click in the design window with the relevant component selected, and choose the last option in the context menu 'Apply Current Properties to All States'. The option is not really flexible though : it will remove all view dependent properties that you ever set for that component. And be careful also with which component you have selected. Right clicking in the design window will select a different component if you're not in the right place with your mouse pointer.