Flex 3:按钮上没有蓝色对焦环

发布于 2024-09-30 15:00:06 字数 1038 浏览 1 评论 0原文

我的按钮周围没有蓝色聚焦环,尽管它有焦点。

我有一个带有 RadioButtonGroup 和 Button 的组件。在 RadioButtonGroup 中进行选择后,焦点将切换到 Button。我在 VBox 上添加了 click="focusManager.setFocus(myCloseButton)" 。

之后,选择一个单选按钮,如果用户单击空格键,则会触发该按钮。 因此,据我了解,焦点已切换到按钮。但是,该按钮周围没有蓝色聚焦环。如何获得对焦环?

(我有visible =“false”。在一些效果完成后,我将它们变为可见。所以,不要让这让你困惑。)

<mx:VBox id="radioVBox"  visible="false" click="focusManager.setFocus(myCloseButton)" >
    <mx:RadioButtonGroup id="rgb1" itemClick="goClickHandler(event); "/>
        <mx:RadioButton  groupName="rgb1" label="{answerA}" value="{answerA}" />
        <mx:RadioButton  groupName="rgb1" label="{answerB}" value="{answerB}" />
        <mx:RadioButton  groupName="rgb1" label="{answerC}" value="{answerC}" />

</mx:VBox>

 <mx:Button id="myCloseButton" label="Close"   
    width="100" height="40"
    fontSize="20" fontWeight="bold" 
    click="closeHandler(event)"   
    visible="false" fontFamily="Verdana"  />

有什么建议吗?

谢谢。

-拉克斯米迪

My button doesn't have a blue focus ring around it, even though it has focus.

I've got a component with a RadioButtonGroup and a Button. After a selection is made in the RadioButtonGroup, focus is switched to the Button. I added click="focusManager.setFocus(myCloseButton)" on the VBox.

After, a radioButton is selected, if the user clicks the spacebar the Button fires.
So, as I understand it focus was switched to the button. But, the button doesn't get a blue focus ring surrounding it. How do I get the focus ring?

(I have visible="false". I turn them to visible, after some effects are finished. So, don't let that throw you.)

<mx:VBox id="radioVBox"  visible="false" click="focusManager.setFocus(myCloseButton)" >
    <mx:RadioButtonGroup id="rgb1" itemClick="goClickHandler(event); "/>
        <mx:RadioButton  groupName="rgb1" label="{answerA}" value="{answerA}" />
        <mx:RadioButton  groupName="rgb1" label="{answerB}" value="{answerB}" />
        <mx:RadioButton  groupName="rgb1" label="{answerC}" value="{answerC}" />

</mx:VBox>

 <mx:Button id="myCloseButton" label="Close"   
    width="100" height="40"
    fontSize="20" fontWeight="bold" 
    click="closeHandler(event)"   
    visible="false" fontFamily="Verdana"  />

Any suggestions?

Thank you.

-Laxmidi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嗼ふ静 2024-10-07 15:00:06

您可以在组件获得焦点后强制 Flex 显示焦点绘图,如下所示:

focusManager.getFocus().drawFocus(true);

另外,您可以尝试以下操作:

myCloseButton.drawFocus(true);

希望它有帮助。

You can force Flex show the focus drawing after your component get focus with something like this:

focusManager.getFocus().drawFocus(true);

also, you can try someting like:

myCloseButton.drawFocus(true);

Hope it helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文