2014-03-13 58 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

相关问题