Flex 中的导航问题 - ViewStack、状态或其他问题?
我对使用 Mate 框架创建的应用程序有一点疑问。 用户要做的第一件事就是登录,因此我创建了 Login.mxml 视图。 成功登录后,我需要显示主视图,顶部有 applicationControlBar,下面有工作区。 目前我有两个独立的视图,所以如果我理解正确的话,使用 ViewStack 是有意义的。
问题是,我还想在登录后在工作区顶部显示某种带有按钮的面板 - 这里是屏幕截图。 单击按钮后,面板应该消失。 让事情变得更复杂的是,该面板有可能改变状态。 单击特定按钮可能会导致面板底部显示进度条。
我觉得我应该创建单独的视图 MenuDialog.mxml 并放置按钮、进度条和状态,但如何将其显示在工作区的顶部? 我希望我的问题足够清楚:)
I have a bit of doubt regarding my application which is being created using Mate framework. The first thing user has to do is to log in, so I created Login.mxml view. After a successful login I need to display the main view with applicationControlBar at the top and a workspace below. At the moment I have two separate views, so if I understand correctly it makes sense using ViewStack.
Thing is, I'd like also to display some kind of panel with buttons on top of the workspace after login - here is screenshot. After clicking on a button the panel should dissapear. To complicate things a little bit more, there is a possibility for this panel to change state. Clicking on a specific button may result in showing progress bar at the bottom of panel.
I feel I should create separate view, MenuDialog.mxml and put there buttons, progress bar and states, but how to display it on the top of the workspace? I hope my problem is clear enough :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会将面板设为弹出窗口,并将主应用程序(或 ViewStack 的父容器)作为弹出窗口的父容器。 您可以使用 PopUpManager 类根据面板中的用户操作将其关闭。
I would make the panel a popUp, with the main application (or the ViewStack's parent container) as the parent of the popUp. You can use the PopUpManager Class to close it based on user actions within the Panel.
假设您可能不想要模态登录样式面板(现在许多应用程序都回避这种面板),那么您绝对应该使用状态而不是 ViewStack。
状态是一种更清晰的方式来区分您的 UI 可以处于的各种状态 -LOGGED_IN、LOGGED_OUT 等。
可能需要一点时间来习惯使用状态,但一旦习惯了,您将永远不会去后退。 :-)
Assuming that perhaps you do not want a modal login style panel (which many apps these days eschew) then you should absolutely use states rather than ViewStacks.
States are a much cleaner way to distinguish the various, uh, states that your UI can be in -LOGGED_IN, LOGGED_OUT, etc.
It may take a little to get used to working with states, but once you do, you'll never go back. :-)