Flex中如何使一个窗口不调整大小? [英] in Flex how do I make a window not resizable?
问题描述
所以我想打开,就是要一个固定大小的窗口,第二个窗口。我设置可调整大小的属性设置为false,但这似乎没有任何效果。
So I'm trying to open a second window that is meant to be a fixed size window. I've set resizable property to false but that doesn't seem to have any effect.
这是我的样品code
here's my sample code
主要应用
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
height="600"
creationComplete="onCreationComplete()">
<fx:Script>
<![CDATA[
import foo.TestWindow;
protected function onCreationComplete():void
{
var window:TestWindow = new TestWindow();
window.open();
}
]]>
</fx:Script>
</s:WindowedApplication>
TestWindow
TestWindow
<?xml version="1.0" encoding="utf-8"?>
<s:Window xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"
resizable="false">
<s:Label text="this window should not be resizable" />
</s:Window>
当我运行此code,我的期望是,TestWindow应该不会改变大小。不过,我可以调整它的大小没有任何问题。我失去了一些东西呢?
When I run this code, my expectation is that TestWindow should not be resizable. however I can resize it without any problem. Am I missing something here?
推荐答案
我使用Flash Builder 4.5和根标签是 S:的WindowedApplication
的不是 S:窗口
如你所说,并没有一个名为调整大小属性。
虽然我一直在寻找一个更好的解决办法,我刚刚发现这一点。希望能帮助你:
的http://www.actionscript-flash-guru.com/blog/16-$c$c-for-a-resizable-window-in-as3
I am using Flash Builder 4.5 and the root tag is s:WindowedApplication
not s:Window
as you said; and there is no property named 'resizable'.
While I was looking for a better solution, I just found this. Hope will help you:
http://www.actionscript-flash-guru.com/blog/16-code-for-a-resizable-window-in-as3
下面是一个非常简单的解决办法:
转到您的应用程序并打开HalloFlex-app.xml文件的src文件夹。这是应用程序的配置文件,并进行以下的最大化和可调整大小的属性调整,在该文件中:
Here is a very simple solution:
Go to the src folder of your application and open HalloFlex-app.xml file. This is the app config file and make following adjustments to the maximizable and resizable properties in this file:
<maximizable>false</maximizable>
<resizable>false</resizable>
这样您的应用程序窗口将既不是调整大小,也不是最大化。 谢谢!
This way your app window will neither be resizable and nor be maximizable. Thanks!
这篇关于Flex中如何使一个窗口不调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!