如何在SAPUI5中自定义Shell容器

问题描述 投票:4回答:4

shell container

我有一个shell容器,在大屏幕上我想充分利用屏幕。我想覆盖整个区域。我如何定制它。

sapui5 sap-fiori sapui5-theming
4个回答
2
投票

使用manifest.json文件并且UI5框架实例化shell控件时,请执行以下操作(不能使用appWidthLimited =“false”,因为您没有包含shell'标记'的xml)。

的manifest.json

...
"sap.ui5": {
    "config": {
        "fullWidth": true
    },
    ...
...

5
投票

我假设您正在使用XML来查看视图。将以下属性appWidthLimited="false"添加到Shell标记中。


4
投票

根据最新的文档,我提到了1.48.X,而且它不再存在于sap.ui5中了:

"sap.ui": {
    "technology": "UI5",
    "icons": {
        "icon": "sap-icon://add-contact",
        "favIcon": "icon/F1373_Approve_Purchase_Orders.ico",
        "phone": "icon/launchicon/57_iPhone_Desktop_Launch.png",
        "phone@2": "icon/launchicon/114_iPhone-Retina_Web_Clip.png",
        "tablet": "icon/launchicon/72_iPad_Desktop_Launch.png",
        "tablet@2": "icon/launchicon/144_iPad_Retina_Web_Clip.png"
    },
    "deviceTypes": {
        "desktop": true,
        "tablet": true,
        "phone": false
    },
    "supportedThemes": [
        "sap_hcb"
    ],
    "fullWidth": true
},

欲了解更多信息:https://openui5.hana.ondemand.com/#/topic/be0cf40f61184b358b5faedaec98b2da

此外,如果您使用sap.m.Shell,那么上述将无济于事。 为此,您需要设置属性appWidthLimited: false

<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>

1
投票

它可以通过XML模板静态完成:

<mvc:View controllerName="letterboxing.widescreen.controller.index" xmlns:mvc="sap.ui.core.mvc" displayBlock="true" xmlns="sap.m">
    <Shell id="shell" appWidthLimited="false">
        <App id="app">
            <pages>
                <Page id="page" title="{i18n>title}">
                    <content></content>
                </Page>
            </pages>
        </App>
    </Shell>
</mvc:View>

或者通过JS控制器动态,将appWidthLimited:false设置为sap.m.Shell

© www.soinside.com 2019 - 2024. All rights reserved.