Flex中使用控件保持居中
0 comments 2010-4-23 14:24:4 72views
horizontalCenter="0" //水平方向永远居中
verticalCenter="0" //竖直方向永远居中
注意:
组 件的parent的layout属性(如果有的话),必须为absolute,这两个样式才会有效
新建项目,复制以下代码
代码 复制 - 运行
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Canvas width="332" height="200" horizontalCenter="0" verticalCenter="0" id="login" backgroundColor="#FFFFFF"> <mx:TextInput x="10" y="10"/> <mx:TextInput x="10" y="40"/> <mx:Button x="114" y="70" label="Login"/> </mx:Canvas> </mx:Application>
0 comments 2010-4-23 14:24:4 72views
horizontalCenter="0" //水平方向永远居中
verticalCenter="0" //竖直方向永远居中
注意:
组 件的parent的layout属性(如果有的话),必须为absolute,这两个样式才会有效
新建项目,复制以下代码
代码 复制 - 运行
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Canvas width="332" height="200" horizontalCenter="0" verticalCenter="0" id="login" backgroundColor="#FFFFFF"> <mx:TextInput x="10" y="10"/> <mx:TextInput x="10" y="40"/> <mx:Button x="114" y="70" label="Login"/> </mx:Canvas> </mx:Application>