SAPUI5 - 垂直布局引力
SAPUI5 - Vertical layout gravity
我在 xml 文件
的屏幕上有几个元素
<core:View controllerName="myapp.view.login.login"
xmlns="sap.m" xmlns:core="sap.ui.core"
xmlns:l="sap.ui.layout">
<l:VerticalLayout >
<l:content>
<Input
type="Text"
maxLength="15"
fieldWidth="15px"
placeholder="name"
textAlign="Center">
</Input>
<Input
type="Password"
maxLength="15"
fieldWidth="15px"
placeholder="password"
textAlign="Center">
</Input>
<Button
text="Log in"
press="logIn">
</Button>
</l:content>
</l:VerticalLayout>
</core:View>
如何添加布局引力或对齐之类的内容,我希望这些元素位于屏幕中央。你能帮我吗?谢谢你。
既然你正在使用 sap.m
库,我建议使用 sap.m.VBox
控件(或 sap.m.HBox
用于水平布局)
VBox
与 VerticalLayout
完全相同,甚至更多(您可以以真正灵活的方式指定对齐方式和对齐方式
VBox
和 HBox
继承自 FlexBox
,请参阅这些示例以了解您可以做什么:https://sapui5.hana.ondemand.com/sdk/explored.html#/entity/sap.m.FlexBox/samples
我在 xml 文件
的屏幕上有几个元素<core:View controllerName="myapp.view.login.login"
xmlns="sap.m" xmlns:core="sap.ui.core"
xmlns:l="sap.ui.layout">
<l:VerticalLayout >
<l:content>
<Input
type="Text"
maxLength="15"
fieldWidth="15px"
placeholder="name"
textAlign="Center">
</Input>
<Input
type="Password"
maxLength="15"
fieldWidth="15px"
placeholder="password"
textAlign="Center">
</Input>
<Button
text="Log in"
press="logIn">
</Button>
</l:content>
</l:VerticalLayout>
</core:View>
如何添加布局引力或对齐之类的内容,我希望这些元素位于屏幕中央。你能帮我吗?谢谢你。
既然你正在使用 sap.m
库,我建议使用 sap.m.VBox
控件(或 sap.m.HBox
用于水平布局)
VBox
与 VerticalLayout
完全相同,甚至更多(您可以以真正灵活的方式指定对齐方式和对齐方式
VBox
和 HBox
继承自 FlexBox
,请参阅这些示例以了解您可以做什么:https://sapui5.hana.ondemand.com/sdk/explored.html#/entity/sap.m.FlexBox/samples