SAPUI5:禁用sap.ui.unified.ShellLayout的滚动条

时间:2015-06-10 14:45:45

标签: shell scrollbar sapui5

我使用的是sap.ui.unified.ShellLayout,顶部是工具栏,下面是sap.ui.core.ComponentContainer。在工具栏停留时,在导航时交换组件容器的内容。不幸的是,整个shell(布局)都有一个滚动条,尽管只有组件容器应该有一个。

如何禁用ShellLayout的滚动?

视图中的方法init:

        sap.ui.unified.ShellLayout.prototype.init.call(this);
    var that = this;

    this.setHeaderVisible(false);

    // action bar
    this.oToolbar = new sap.m.Toolbar({
        transparent: true,
        content: [
            new sap.m.ToolbarSpacer(),
            new sap.m.Text({
                text: "Elektronischer Einkaufszettel"
            }),
            new sap.m.ToolbarSpacer()
        ],
        height: "3rem"
    });
    this.addContent(this.oToolbar);

    this.oComponentContainer = new sap.ui.core.ComponentContainer({
        name: 'router',
        enableScrolling: true
    });
    this.addContent(this.oComponentContainer);

    this.oFlexBox = new sap.m.FlexBox({
        alignItems: "Start",
        items: [
            new sap.m.Button({
                width: "100%",
                type: "Transparent",
                icon: "sap-icon://product",
                class: "sapUiSmallMarginEnd",
                layoutData: new sap.m.FlexItemData({
                    growFactor: 1
                }),
                press: function(oEvent) {
                    var sTarget = "Products";
                    that.onButtonClick(oEvent, that, sTarget);
                }
            }),
            new sap.m.Button({
                width: "100%",
                type: "Emphasized",
                icon: "sap-icon://cart",
                class: "sapUiSmallMarginEnd",
                layoutData: new sap.m.FlexItemData({
                    growFactor: 1
                }),
                press: [that, "ShopperMenu", that.onButtonClick]
            }),
            new sap.m.Button({
                width: "100%",
                type: "Transparent",
                icon: "sap-icon://list",
                class: "sapUiSmallMarginEnd",
                layoutData: new sap.m.FlexItemData({
                    growFactor: 1
                }),
                press: [that, "RequesterMenu", that.onButtonClick]
            })
        ]
    });
    this.addContent(this.oFlexBox);

由于

enter image description here

1 个答案:

答案 0 :(得分:1)

我终于找到了使用sap.ui.layout.FixFlex控件的解决方案。

此致

安东