2014-12-03 161 views
1

我试图将页面添加到IconTabFilter中,但是只有标题投射在屏幕上。Sapui5将页面添加到IconTabFilter内容

IconTab视图:IconTabFilter鉴于

createContent : function(oController) { 
    var oPage = new sap.m.Page({title: "IconTab",showHeader: false}); 
    var oIconTab = new sap.m.IconTabBar ("idTabBar",{}); 
    var itemBar1 = new sap.m.IconTabFilter({ 
     key:"tab1", 
     icon:"sap-icon://database", 
     content:[ new sap.ui.view({id:"idTabIcon",viewName:"prova5.tabIcon1", type:sap.ui.core.mvc.ViewType.JS}) 
     ] 
    }) 
    oIconTab.addItem(itemBar3); 

    oPage.addContent(oIconTab); 

    return oPage; 

} 

内容:

createContent : function(oController) { 
    var oPage = new sap.m.Page({ 
     title: "Icon Tab Page 1", 
     showNavButton: true, 
     navButtonPress: oController.navButtonMethod 
    }); 
    var obutton = new sap.m.Button({text: "hello"}); 
    oPage.addContent(obutton); 


    return oPage; 

} 

任何溶液?

回答

0

尝试检查元素并找到div,并在 类“.sapMITBContent”在Pixel约500px处添加高度,您将看到页面可见。

+0

我该如何获得.sapMITBC内容? – Mmarset 2014-12-04 10:52:52

+0

转到chrome中的开发人员工具并转到元素选项卡,然后检查iconTabBar中存在的页面,您可以找到类“.sapMITBContent”。 – Abul 2014-12-04 13:02:09

+0

这不是正确的做法。这是检查/调试的“解决方法”,但不适合高效使用。 – Breakpoint 2014-12-09 07:29:44

1

在您的视图中使用sap.m.Page作为createContent函数的返回值时会出现此问题。如果在您的视图中使用sap.m.Page不是您需要的,请尝试返回其他控件(例如sap.m.FlexBox)。这解决了我的问题。

相关问题