图像上的 Adobe Flex 居中标签
Adobe Flex center label over image
我试图将标签置于图像的中央,但它不起作用,它停留在左上角....请帮助:
<mx:Canvas>
<mx:Image id="img" showEffect="Fade" completeEffect="{fader}" />
<s:HGroup verticalAlign="middle" horizontalAlign="center">
<mx:Label id="touchBegin" text="Touch the screen to continue" fontSize="72" />
</s:HGroup>
</mx:Canvas>
我没有打开 IDE,但我很确定那是因为 hgroup
的宽度与图像的宽度不匹配,试试:
<s:HGroup verticalAlign="middle" horizontalAlign="center" width="{img.width}">
我试图将标签置于图像的中央,但它不起作用,它停留在左上角....请帮助:
<mx:Canvas>
<mx:Image id="img" showEffect="Fade" completeEffect="{fader}" />
<s:HGroup verticalAlign="middle" horizontalAlign="center">
<mx:Label id="touchBegin" text="Touch the screen to continue" fontSize="72" />
</s:HGroup>
</mx:Canvas>
我没有打开 IDE,但我很确定那是因为 hgroup
的宽度与图像的宽度不匹配,试试:
<s:HGroup verticalAlign="middle" horizontalAlign="center" width="{img.width}">