Flex:旋转按钮和改变焦点
我在 Flex 中旋转按钮时遇到问题。它们似乎污染了其他组件的焦点矩形。
获取以下源代码,这再简单不过了:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:VBox width="100%" height="100%">
<mx:Spacer height="100" />
<mx:Button rotation="10" />
<mx:TextArea rotation="0" />
</mx:VBox>
</mx:WindowedApplication>
现在执行它。单击文本区域,焦点矩形正确。按两次 Tab 键,围绕 TextArea 的焦点矩形将旋转!
有没有解决这个问题的方法,或者我应该完全避免旋转按钮?
我正在使用 Flex SDK 3.5。
谢谢,
丹尼尔
I've got a problem with rotated buttons in Flex. They seem to contaminate other components' focus rectangles.
Take the following source code, which couldn't be much simpler:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:VBox width="100%" height="100%">
<mx:Spacer height="100" />
<mx:Button rotation="10" />
<mx:TextArea rotation="0" />
</mx:VBox>
</mx:WindowedApplication>
Now execute it. Click in the text area, the focus rectangle is correct. Press tab twice, the focus rectangle aroung the TextArea is rotated!
Is there a fix for this, or should I avoid rotating buttons altogether?
I'm using Flex SDK 3.5.
Thanks,
Daniel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最近也偶然发现了这个错误。这是建议修复的链接。
然而,我想知道是否有一个更通用的解决方案,而不是扩展每个组件并覆盖调整焦点矩形。
我想出了扩展 FocusManger 并重写 focusPane 的 getter,如下所示:
并将其设置为应用程序的焦点管理器:
这似乎有效,但如果一些专家能够告诉我是否存在我不知道的陷阱,那就太好了。
I as well recently stumbled upon this bug. Here's a link to suggested fix.
However, I was wondering if there's a more general solution rather then extending each and every component and overriding adjustFocusRect.
I came up with extending FocusManger and overriding the getter for focusPane as follows:
and set it as application's focus manager:
This seems to work, though would be nice if some expert could tell if there aren't any pitfalls I'm not aware of.
看起来像是 Flex SDK 中的一个错误。我看到下一个选项:
第三代的最后一个SDK
棘手...)
此外,您可能会在 Adobe 的跟踪器中提交错误,但它们已深入到第 4 代 Flex。
更新:3.6 nightly build 也包含此错误。
Seems like a bug in Flex SDK. I see next options:
last SDK of third generation
tricky...)
Also, you may file a bug in Adobe's tracker, but they're deep into 4-th generation of Flex.
Update: 3.6 nightly build contains this bug, too.