2014-01-24 69 views
2

我一直在通過sencha touch 2開發一個android應用程序。當前的天氣和日常預測都是用html類型構建的。我希望每小時預測會顯示在水平滾動面板中,所以我不得不使用DataView類型(http://docs.sencha.com/touch/2.3.0/#!/api/Ext.dataview.DataViewSencha Touch 2:dataview在Android模擬器中不可見

不幸的是,我無法使它在Android模擬器中工作。請看下面的截圖,看看模擬器和chrome之間的區別。我也沒有在ADT和Chrome控制檯日誌中看到任何錯誤。

http://i.stack.imgur.com/Mxzrt.png

這裏是我的源代碼,這些項目是一個轉盤的卡內。感謝您的時間閱讀我的問題。

items: [{ 
      height: '50%', 
      html: tplCurr.apply(obj) 
     }, { 
      height: '10%', 
      xtype: 'dataview', 
      cls: 'hourly-container', 
      scrollable: { 
       direction: 'horizontal', 
       directionLock : true 
      }, 
      inline: { wrap: false }, 
      data: obj.hourly, 
      itemTpl: tplHourly 
     }, { 
      height: '40%', 
      xtype: 'panel', 
      cls: 'daily-container', 
      fullscreen: true, 
      scrollable: { 
       direction: 'vertical', 
       directionLock : true 
      }, 
      items: dayItems 
     }] 
+0

這將是有益的,如果你能後父容器的代碼或者至少是佈局屬性。您是否使用'vbox'進行佈局?嘗試在每個容器上使用flex屬性而不是高度(例如,flex:5,flex:1,flex:4) –

回答

0

試試這個請,

layout:{ 
    type:'vertical' 
}, 
items: [{ 
      flex:4, 
      html: tplCurr.apply(obj) 
     }, { 
      flex:1, 
      xtype: 'dataview', 
      cls: 'hourly-container', 

      scrollable: { 
       direction: 'horizontal', 
       directionLock : true 
      }, 
      inline: { wrap: false }, 
      data: obj.hourly, 
      itemTpl: tplHourly 
     }, { 
      flex:2, 
      xtype: 'panel', 
      cls: 'daily-container', 
      fullscreen: true, 
      scrollable: { 
       direction: 'vertical', 
       directionLock : true 
      }, 
      items: dayItems 
     }] 
+0

您可能會簡要地解釋她正在做什麼以及您正在做什麼 –