加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

panel,button的用法--flex--宽/高-application也可以设置w/h

发布时间:2020-12-15 03:49:13 所属栏目:百科 来源:网络整理
导读:?xml version="1.0" encoding="utf-8"? !--所有组件使用默认值-- mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" !--使用容器大小默认值-- mx:Panel title="默认的面板容器大小和按钮控件大小" !--使用控件大小默认值-- mx:Button id="button1"

<?xml version="1.0" encoding="utf-8"?>
<!--所有组件使用默认值-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<!--使用容器大小默认值-->
<mx:Panel title="默认的面板容器大小和按钮控件大小" >
<!--使用控件大小默认值-->
<mx:Button id="button1" label="按钮" />
</mx:Panel>
</mx:Application>


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<!--定义面板容器宽度为200像素,高度为0像素-->
	<mx:Panel title="绝对值设置控件大小示例" width="200" height="200">
		<!--定义按钮宽度为160像素,高度为25像素-->
		<mx:Button id="button1" label="按钮" width="160" height ="25"/>
	</mx:Panel>
</mx:Application>

application也可以设置w/h

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="500" height="400">
	<!--定义面板容器宽度为应用容器的50%,高度为应用容器的50%-->
	<mx:Panel title="相对值设置控件大小示例" width="50%" height="50%">
		<!--定义按钮宽度为面板宽度的50%,高度为面板高度的50%-->
		<mx:Button id="button1" label="按钮" width="50%" height ="50%"/>
	</mx:Panel>
</mx:Application>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读