Step 12: Shell Control as Container && Step 13:Margins and Paddings 使用CSS类对页面美化

一、基本概念

Shell 控件作为应用程序的主要容器。这是一个比较旧但功能强大的布局控件,用于创建企业级应用程序的壳(Shell)结构。

二、练习

相同操作,先新建文件夹12,复制上一步骤UI5_Walkthrough_Step 11: Pages and Panels

内容到12文件夹

2.1 App.view.xml

XML 复制代码
<mvc:View
   controllerName="sap.ui5.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>panelTitle1}">
                     <content>
                        <Button
                        text="{i18n>ButtonText}"
                        press="onPress"
                        class="sapUiSmallMarginEnd"/>
                        <Input 
                        id="input2"
                        value="{/recipient/name}"
                        valueLiveUpdate="true"
                        width="60%"/>
                        <Text
                        text="{i18n>textDesc} {/recipient/name}"                       
                        class="sapUiSmallMargin"/>
                     </content>
                  </Panel>
               </content>
            </Page>
         </pages>
      </App>
   </Shell>
</mvc:View>

与Step_11相比,

2.1.1 新增了根标签 <Shell>

2.2.2 Button标签新增class="sapUiSmallMarginEnd",的主要作用是在元素的右侧(结束方向)添加一个标准的小间距。

2.2.3 Input标签去掉了 description属性,

2.2.4新增Text标签显示内容即上一练习中的 description,且新增 class="sapUiSmallMargin"

作用是文本框四方添加统一的小间距。

2.2 运行结果

相关推荐
zzzzzz31014 天前
NVIDIA 开源 SkillSpector:AI Agent 技能安全扫描器,你的 Agent 装了个定时炸弹?
机器学习·shell·cto
ScilogyHunter17 天前
Zephyr Shell完全指南
shell·zephyr
七夜zippoe17 天前
OpenClaw 节点命令执行:远程Shell与系统操作实战
github·shell·openclaw·nodes·系统操作
Mr -老鬼20 天前
EasyClick 入门指南:Shell 命令与 ADB 完全指南
android·adb·自动化·shell·easyclick·易点云测
tianyuanwo23 天前
Shell 脚本中的“字典”功能:从基础到工程化的最佳实践
shell·字典
爱睡觉11123 天前
在 Android 模拟器 Shell 下运行 ncnn 推理的性能排查记录
linux·shell
Bolt24 天前
Kimi code 用不了 Figma?看这里解决
shell·mcp
星光不问赶路人1 个月前
Shell 脚本避坑指南:从模式匹配到错误处理的实用技巧
shell
pr_note1 个月前
balance_points
shell·tcl
pr_note1 个月前
icc2/fc屏蔽指定warning
shell·tcl