2014-03-13 57 views
0

我使用sencha 2.3.1和下面的代碼(在app.js中)在頁面上顯示一些html內容。但沒有任何顯示。請告訴我錯在哪裏。在開始應用程序sencha touch上沒有任何顯示

Ext.application({ 
    name: 'Sencha', 


    requires: ['Ext.tab.Panel'], 

    launch: function() { 
     //The whole app UI lives in this tab panel 
     Ext.Viewport.add({ 
      xtype: 'tabpanel', 
      fullscreen: true, 
      tabBarPosition: 'bottom', 

      items: [ 
       // This is the home page, just some simple html 
       { 
        title: 'Home', 
        iconCls: 'home', 
        cls: 'home', 
        scrollable: true, 
        html: [ 
         '<img height=260 src="http://staging.sencha.com/img/sencha.png" />', 
         '<h1>Welcome to Sencha Touch</h1>', 
         "<p>Building the Getting Started app</p>", 
         '<h2>Sencha Touch (2.0.0)</h2>' 
        ].join("") 
       } 

       ] 

      }) 

     } 

}); 

回答

0

在Sencha Fiddle中做了一個快速檢查,並且您的內容似乎顯示。

https://fiddle.sencha.com/#fiddle/48m

不過,我看你連接一個CLS屬性,這一個tabpanel,也許這是造成你的問題。

此外,由於組件的高度爲零,因此常常不會顯示在Sencha中。打開你的DOM檢查器,找到你的tabpanel和子元素,並確保它們的高度大於零。您可能需要定義一個高度,或使用不同的佈局,如適合。

+0

發現錯誤。 1. Sencha不能在Firefox上運行。 2.試圖直接運行indx.html文件,而不啓動服務器。 – user3263192

+0

看看我的答案對這個後 http://stackoverflow.com/questions/17542769/ext-ajax-request-not-working-in-browser/17552519#17552519 可以與網頁文件運行安全被禁用。 – tabrindle

相關問題