2013-04-29 64 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"/>