How to observe the visibility of a child node?

瘦欲@ 提交于 2019-12-12 13:52:10

问题


When a parent node becomes invisible a child becomes invisible too without modifying child visible property. So how can the visibility of a child node be observed without observing all parent nodes and the hierarchy? Is there a proper event fired?


回答1:


I don't think there is a direct way to achieve what you want. There is no property to observe and no event is fired when the parent visibility changes.

You can take a look at the internal implementation of Node.parentPropertyImpl(), which basically does what you want to avoid: it adds an InvalidationListener to the parent's impl_treeVisibleProperty (internal API and deprecated).



来源:https://stackoverflow.com/questions/33185073/how-to-observe-the-visibility-of-a-child-node

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!