更改标题窗口关闭按钮
我正在使用 Flex 3.4 SDK。
我需要更改 TitleWindow 中的默认关闭按钮图像。所以我正在做的是定义一个 CSS 选择器,如下所示:
TitleWindow{
close-button-skin: Embed('assets/close.png');
border-color: #FFFFFF;
corner-radius: 10;
closeButtonDisabledSkin: ClassReference(null);
closeButtonDownSkin: ClassReference(null);
closeButtonOverSkin: ClassReference(null);
closeButtonUpSkin: ClassReference(null);
}
问题是:结果图像完全被挤压得无法识别。可能是因为图像尺寸为 55x10 像素(比默认的关闭按钮方形尺寸宽得多),并且 flex 强制它适应该尺寸。
有人知道如何解决这个问题吗?
I'm working with Flex 3.4 SDK.
I need to change the default close button image from a TitleWindow. So what I'm doing is defining a CSS selector, like this:
TitleWindow{
close-button-skin: Embed('assets/close.png');
border-color: #FFFFFF;
corner-radius: 10;
closeButtonDisabledSkin: ClassReference(null);
closeButtonDownSkin: ClassReference(null);
closeButtonOverSkin: ClassReference(null);
closeButtonUpSkin: ClassReference(null);
}
The problem is: the result image is totally squeezed beyond recognition. Probably because the image dimensions are 55x10 pixels (much wider than the default closebutton square-like dimensions) and flex forces it to fit that size.
Would anyone know how to go about fixing that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
似乎在 Panel 类的 createChildren() 方法中宽度和高度设置为 16 像素:
您可以尝试将explicitWidth 和explicitHeight 设置为窗口中所需的值。不要忘记将 closeButton 的范围设置为 mx_internal,并导入并使用该命名空间。
It seems like the width and height are set to 16 pixels in the Panel class' createChildren() method:
You could try setting the explicitWidth and explicitHeight to the values you need in your window. Don't forget to scope closeButton to mx_internal, and import and use that namespace.
如果你想要更简单,请执行此操作,
导入类
将这 3 行放入creationComplete处理程序中
If you want it more simple, do this,
Import the class
Put these 3 lines in creationComplete handler