2014-12-03 91 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)。這解決了我的問題。

相關問題