Flex 画布调整大小
我希望在 Flex 中从屏幕上实现某种行为。
我的屏幕分为 2 个区域:导航器窗格和内容窗格。(从左到右)
当我缩小浏览器时,我希望内容窗格显示滚动条并且组件保持原来的大小。
当我将浏览器向右扩展(例如在宽屏幕中)时,我希望组件(例如 DataGrid)将
向右扩展。
我该怎么做?是用 minWidth 和 minHeight 完成的吗?
谢谢,
I have a certain behavior that i want from my screen to implement in Flex.
My screen is devided to 2 areas: Navigator pane and content pane.(from left to right)
When I shrink the browser, i want the content-pane show scroll bars and the components stay the same size originally.
When I expand the browser to right(like in wide screen), i want that components (like DataGrid) will
expand to right.
How can i do it? Is it done with minWidth and minHeight?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现执行此类操作的最简单方法是覆盖测量函数或 updateDisplayList 函数并手动设置大小。有时最小/最大尺寸有效,有时则无效。
I've found that the easiest way to do stuff like this is to override either the measure function or the updateDisplayList function and set the sizes manually. Sometimes min/max sizes work, sometimes they don't.
我找到了一个解决方案:我用 mx:Panel 替换了 mx:Canvas,这样效果更好。正如我所期望的。
高度和宽度以百分比表示。面板上还有minWidth、minHeight定义。一旦框架进入 minWidth 或 minHeight 属性,滚动条就会打开。
重要提示:如果您使用 ANT (mxmlc) 进行编译,您可能会使用另一个配置文件(即 Flash Builder 使用的配置文件以外的配置文件)。
请注意,每个参数都有不同的参数。另请注意,它们每个都可能生成嵌入 swf 的不同 .html 文件。(根据 html 模板)(例如 width 参数)
I found a solution: I replaced the mx:Canvas with mx:Panel and this works better. as i expect.
Height and Width are with percentage representation. There is also minWidth, minHeight
definitions on the panel. once the frame goes under minWidth or minHeight propeties, scrollbars are opened.
important NOTE: if you compile with ANT (mxmlc), you may used another config file (i.e. other than the one Flash Builder uses).
note that each one has different parameters. also note that each one of them may generate a different .html file that embedds the swf.(according to the html template) (for example width parameter)