Flex 登录布局实例

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>
	<s:Panel width="376" height="244" horizontalCenter="0" verticalCenter="0" fontSize="14">
		<s:HGroup>
			<s:BorderContainer borderWeight="0">
				<s:Image horizontalCenter="0" source="assets/images/loginIcon.png"/>
			</s:BorderContainer>
			<s:Form width="261" height="192">
				<s:FormItem  label="Username: " width="250">
					<s:layout>
						<s:BasicLayout/>
					</s:layout>
					<s:TextInput id="uname" x="-111" width="136"/>
				</s:FormItem>
				<s:FormItem label="Password: "  width="249">
					<s:layout>
						<s:BasicLayout/>
					</s:layout>
					<s:TextInput id="pwd" x="-111" width="136"/>
				</s:FormItem>
				<s:CheckBox id="isSaveUnameAndPwd" width="236" label="Save  UserName  And  Password"/>
				<s:HGroup width="239" height="28" horizontalAlign="right">
					<s:Button width="72" height="26" label="Login"/>
					<s:Button width="72" height="26" label="Cancel"/>	
				</s:HGroup>
				<s:FormItem label="The username is not existed" id="errorTip" visible="false"/>
			</s:Form>
		</s:HGroup>
		
	</s:Panel>
</s:Application>

 备注:

   1、用于保证panel居中

horizontalCenter="0" verticalCenter="0"

   

   2、在panel中设置了字体大小之后,panel内部的组件无需重复设置。

fontSize="14"

   

   3、设置了basiclayout之后,组件的位置就可以拖动了

<s:layout>
	<s:BasicLayout/>
</s:layout>

   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值