Flex HBox 具有背景颜色和圆角,布线问题
我在 Flex 中遇到了一个奇怪的问题。我有一个带有 HBox 和标签的画布。请找到下面的代码。
<mx:VBox verticalAlign="top" horizontalAlign="center"
fontSize="12" fontWeight="normal" verticalGap="0">
<mx:Label text="Cover" />
<mx:Canvas width="120" styleName="pbcontainer">
<mx:HBox id="pb" height="35" />
<mx:Label id="dashboard_cover" fontWeight="normal"
fontSize="20" horizontalCenter="0" verticalCenter="0"/>
</mx:Canvas>
</mx:VBox>
.pbcontainer {
cornerRadius: 15;
backgroundColor: #FFFFFF;
borderStyle: solid;
borderThickness: 2;
borderColor: #000000;
}
我试图在这里实现一个 ProgressBar
。 现在的问题是,如果 pb
的 percentWidth
小于 5,haloBlue
颜色就会溢出,这是不希望的。请找到下面的图片。谁能帮我解决这个问题。
谢谢,
安吉
I am facing a wiered problem in Flex. I Have a canvas with a HBox and Label. Please find the code below.
<mx:VBox verticalAlign="top" horizontalAlign="center"
fontSize="12" fontWeight="normal" verticalGap="0">
<mx:Label text="Cover" />
<mx:Canvas width="120" styleName="pbcontainer">
<mx:HBox id="pb" height="35" />
<mx:Label id="dashboard_cover" fontWeight="normal"
fontSize="20" horizontalCenter="0" verticalCenter="0"/>
</mx:Canvas>
</mx:VBox>
.pbcontainer {
cornerRadius: 15;
backgroundColor: #FFFFFF;
borderStyle: solid;
borderThickness: 2;
borderColor: #000000;
}
I am trying to implement a ProgressBar
here.
Now, the problem is if the percentWidth
of pb
is less than 5, the haloBlue
color is spilling out which is not desired. Please find the image below. Can anyone help me in solving this issue.
Thanks,
Anji
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是一个想法,不要使用带有背景的
HBox
,而是尝试使用ProgressBar
并设置其进度,而不是的
。percentWidth
HBox编辑:哦,好吧,根据评论中的讨论,似乎上述解决方案不可行。您是否尝试在内部
HBox
上设置cornerRadius
?就是那个蓝色背景的不是吗?Just an idea, instead of using an
HBox
with a background, try using aProgressBar
and set its progress instead ofpercentWidth
of theHBox
.Edit: Oh well, based on the discussion in the comments, it seems the above solution is not feasible. Did you try setting the
cornerRadius
on the innerHBox
? It is the one with the blue background isn't it?