flex中HBox,VBox的布局、其中组件的布局 (自动居中)
发布时间:2020-12-15 03:50:25 所属栏目:百科 来源:网络整理
导读:HBox 是横向布局, VBox 是重向布局。 HBox 、 VBox 组件都有属性 horizontalAlign , horizontalCenter , verticalAlign , verticalCenter 。 而 horizontalAlign , horizontalCenter 是水平居中, verticalAlign , verticalCenter 是垂直居中。 ? hori
HBox 是横向布局,VBox是重向布局。 HBox、VBox组件都有属性horizontalAlign ,horizontalCenter,verticalAlign,verticalCenter。 而horizontalAlign ,horizontalCenter是水平居中,verticalAlign,verticalCenter是垂直居中。 ? horizontalAlign 的属性值是left(左边),center(中间),right(右边)。 verticalAlign的属性值是top(顶部),middle(中间),bottom(底部)。 而horizontalCenter,verticalCenter都是绝对布局。 eg: <!-- Modify by Peter 自动居中按钮 --> <mx:HBox width="100%" height="100%" verticalCenter="0" verticalAlign="middle" horizontalAlign="center" horizontalCenter="0"> <mx:Button label="{this.resourceManager.getString('language','btn.close')}" click="close()" icon="{ModelLocator.closeIcon}"/> <mx:Button id="btnSave" enabled="true" label="{this.resourceManager.getString('language','btn.save')}" click="saveCheck(event)" icon="{ModelLocator.saveIcon}"/> </mx:HBox> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |