如何在 Flex 3 中使画布组件完全不透明?
我创建了一个画布组件并将其添加为父画布组件的子组件。我为子组件设置了 opaqueBackground 属性,使其在父组件上不透明。但是,当我添加两个子组件时,它们彼此之间并不是不透明的。如何设置才能使一个子组件完全覆盖另一个子组件?
I have a canvas component that I create and add as a child of a parent canvas component. I set the opaqueBackground property for the child component which makes it opaque over the parent component. However, when I add two child components, they are not opaque over each other. How do I set it up so that one child component completely covers up the other child component?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一个想法:
1)你使用cacheAsBitmap吗? opaqueBackground 专为使用而设计使用cacheAsBitmap 来改善渲染。如果您只想使某些内容透明,则 alpha 更适合您?
第二个想法:
2)样式是继承的,但属性通常不是。如果要将属性值传递给组件的子组件之一,请重写属性设置方法以设置标志和 invalidateProperties()。然后使用 commitProperties() 来设置你的孩子。
第三个想法:
3)听起来您可能只想让一个孩子同时活跃。也许您想研究使用 visible 属性或 ViewStack 或状态?
First thought:
1) Are you using cacheAsBitmap? opaqueBackground is designed for use with cacheAsBitmap in order to improve rendering. If you just want to make something transparent, would alpha work better for you?
Second thought:
2) Styles are inherited, but properties generally aren't. If you want to pass the property value onto one of a component's children, override the property set method to set a flag and invalidateProperties(). Then use commitProperties() to set your children.
Third thought:
3) It sounds like you may want only one child active at once. Perhaps you want to look into using the visible property or a ViewStack or states?