我想在 VBox 下方的一行中显示三个不同的文本片段,因此我创建了一个 HBox 并将文本组件放置在此处:
<mx:HBox width="100%">
<mx:Text text="left" id="textLeft"/>
<mx:Text text="center" id="textCenter"/>
<mx:Text text="right" id="textRight"/>
</mx:HBox>
我希望 id 为“textLeft”的文本位于 HBox 的最左侧,textCenter 位于中间,textRight 位于右侧...
任何解决方案/指针表示赞赏。
最佳答案
尝试
<mx:HBox width="100%">
<mx:Text text="left" id="textLeft"/>
<mx:Spacer width="100%" />
<mx:Text text="center" id="textCenter"/>
<mx:Spacer width="100%" />
<mx:Text text="right" id="textRight"/>
</mx:HBox>
或
<mx:HBox width="100%">
<mx:Text text="left" id="textLeft" textAlign="left" width="100%"/>
<mx:Text text="center" id="textCenter" textAlign="center" width="100%"/>
<mx:Text text="right" id="textRight" textAlign="right" width="100%"/>
</mx:HBox>
就我个人而言,我会选择排名第一的
关于apache-flex - 在 Flex 中定位文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/995759/