1
<?xml version="1.0"?>
<!-- styles/TimeFormat.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="red">

    <mx:Style>
    Button
    {
        marginLeft: 500px;

    }

    </mx:Style>
    <mx:Button label="Start" />
</mx:Application>

marginLeft 不起作用,我怎样才能将按钮从默认的中心移到其他地方?

4

3 回答 3

3

我尝试过以样式进行操作,并且效果很好:

在此处输入图像描述

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" 
            minWidth="955" minHeight="600">
<mx:Style>
    Button
    {
        left: 500px;
        top: 20px;
    }
</mx:Style>
<mx:Button label="Hello"/>
</mx:Application>
于 2013-04-29T10:30:55.603 回答
1
Alternate you can add <mx:Spacer width="500"/>
于 2013-04-30T10:02:39.280 回答
0

if you want to move the button, use left or x properties:

<mx:Button label="Start" left="500" />
于 2013-04-29T09:36:48.890 回答