Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有很多按钮HBox。我没有禁用每个按钮,而是禁用了HBox. 但是即使HBox禁用了我也可以单击按钮。禁用父组件不会对其子组件产生影响吗?它显示为禁用,但会生成鼠标事件。请问您能给我一些建议吗?...
HBox
当您想要禁用 HBox 时,还可以尝试将 mouseChildren 和 mouseEnabled 设置为 false。这样,孩子的点击也将被禁用。
myHBox.enabled = false; myHBox.mouseChildren = false; myHBox.mouseEnabled = false;