How to customise Shell container in SAPUI5

浪尽此生 提交于 2019-12-14 03:48:00

问题


I've a shell container and on big screens i want to utilize full with of screen. i want to cover full area. how i can customize it.


回答1:


When working with a manifest.json file and the UI5-framework instantiates a shell control, do the following (appWidthLimited="false" cannot be used as you don't have a xml containing a shell 'tag').

manifest.json

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



回答2:


I assume you are using XML for your views. Add the following attribute appWidthLimited="false" to the Shell tag.




回答3:


As per latest documentation, I referred to 1.48.X, and it's not there in the sap.ui5 anymore:

"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
},

For more info: https://openui5.hana.ondemand.com/#/topic/be0cf40f61184b358b5faedaec98b2da

Also, if you are using sap.m.Shell, then the above will not help.
For that you need to set the property 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>



回答4:


It can be done either statically, via XML-template:

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

Or dynamically via JS-controller, which will set appWidthLimited:false to the sap.m.Shell.



来源:https://stackoverflow.com/questions/40135592/how-to-customise-shell-container-in-sapui5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!