这是情景:
<s:layout>
<s:VerticalLayout verticalAlign="top" horizontalAlign="center" paddingTop="30"/>
</s:layout>
<s:states>
<s:State name="Login"/>
<s:State name="Register"/>
</s:states>
<s:Panel id="loginPanel" title="Login Form" title.Register="Registration Form" height="400" width="300" color="Black">
<s:Form top="0" bottom="0"
left="20" right="0">
<s:FormItem label="First Name:" includeIn="Register" color="White">
<s:TextInput id="firstName" color="Black"/>
</s:FormItem>
<s:FormItem label="Last Name" includeIn="Register" color="White">
<s:TextInput id="lastName" color="Black" />
</s:FormItem>
<s:FormItem label="Email:" includeIn="Login, Register" color="White">
<s:TextInput id="email" color="Black" />
</s:FormItem>
<s:FormItem label="Password:" includeIn="Login, Register" color="White">
<s:TextInput id="password" color="Black" displayAsPassword="true"/>
</s:FormItem>
<s:FormItem label="Conform:" includeIn="Register" color="white">
<s:TextInput id="confirm" color="Black" displayAsPassword="true"/>
</s:FormItem>
<s:FormItem >
<s:Button label="Need To Register" id="needToRegister" includeIn="Login" click="currentState='Register'" left="0"/>
<s:Button label="Return To Login" id="returnToLogin" includeIn="Register" click="currentState='Login'"/>
<s:Button label="Login" id="login"
label.Register="Register" click="loginFun()"
click.Register="register()"/>
</s:FormItem>
</s:Form>
问题是如何按水平顺序对齐按钮?我试过HGroup。但是当我们使用HGroup时,按钮是不合理的。如果还有其他内容,请与我分享。
提前致谢。
修改
我做到了。
<s:FormItem >
<s:layout>
<s:HorizontalLayout gap="30" paddingLeft="-15"/>
</s:layout>
<s:Button label="Need To Register" id="needToRegister"
includeIn="Login" />
<s:Button label="Return To Login" id="returnToLogin" includeIn="Register" />
<s:Button label="Login" id="login"
label.Register="Register"/>
</s:FormItem>
现在它的工作。但我不知道。这是一种正确的方法。谁能告诉我这是一个好方法呢?