相关疑难解决方法(0)

如何禁用信箱并为宽屏调整 UI5?

我有一个基于 UI5 的应用程序 (1.66+),它可以正常工作,但屏幕左右两侧有巨大的空白区域(又名信箱打开):

宽屏 SAPUI5 应用程序

我想禁用信箱以使用整个屏幕空间。

到目前为止,我尝试了以下方法:

  1. "fullWidth": truemanifest.json 的sap.ui部分中使用
  2. 要将桌面相关的类添加到index.html 中的 HTML 标签:
<html class="sap-desktop sapUiMedia-Std-Desktop sapUiMedia-StdExt-LargeDesktop">
Run Code Online (Sandbox Code Playgroud)
  1. 添加appWidthLimited: falseindex.html
<script>
    sap.ui.getCore().attachInit(function () {
        new sap.m.Shell({
            app: new sap.ui.core.ComponentContainer({
                height: "100%",
                name: "APPNAME"
            }),
            appWidthLimited: false
        }).placeAt("content");
    });
</script>
Run Code Online (Sandbox Code Playgroud)

就像《如何在 SAPUI5 中自定义 Shell 容器》中描述的那样

但它们都不适合我。

更新:
我成功地通过静态 XML 模板解决了这个问题——只需添加<Shell id="shell" appWidthLimited="false">到主 XML 模板中,但现在我想了解如何通过 JS 在new sap.m.Shell(…)定义中实现它。

代码实验的起点如下。

索引.html

<!DOCTYPE html>
<html>
    <head> …
Run Code Online (Sandbox Code Playgroud)

widescreen sapui5

5
推荐指数
1
解决办法
3000
查看次数

标签 统计

sapui5 ×1

widescreen ×1