现在使用 shell 控件作为应用的容器,并将其用作新的根元素。shell通过在桌面屏幕上引入所谓的信箱来照顾应用程序对设备屏幕尺寸的视觉适应。
webapp/view/App.view.xml这段代码将App包裹在shell内部了
<mvc:View
controllerName="sap.ui.demo.walkthrough.controller.App"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc"
displayBlock="true">
<Shell>
<App>
<pages>
<Page title="{i18n>homePageTitle}">
<content>
<Panel
headerText="{i18n>helloPanelTitle}">
<content>
<Button
text="{i18n>showHelloButtonText}"
press=".onShowHello"/>
<Input
value="{/recipient/name}"
description="Hello {/recipient/name}"
valueLiveUpdate="true"
width="60%"/>
</content>
</Panel>
</content>
</Page>
</pages>
</App>
</Shell>
</mvc:View>
shell 控件现在是我们应用最外层的控件,如果屏幕尺寸大于特定宽度,则会自动显示所谓的信箱。
**结果:**可以看到,页面居于中间位置了