2013-04-29 46 views
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不起作用,我怎樣才能將按鈕從默認中心移動到其他地方?Flex如何保證金按鈕

回答

3

我試圖做到這一點的風格和它的工作:

enter image description here

<?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> 
0

如果要移動的按鈕,使用左或x屬性:

<mx:Button label="Start" left="500" /> 
+0

我可以在樣式中編寫這個嗎?但是左邊和右邊在樣式中不起作用 – Hello 2013-04-29 09:37:24

1
Alternate you can add <mx:Spacer width="500"/>