Extjs 启动应用程序sencha touch时未显示任何内容
我使用Sencha2.3.1和以下代码(在app.js中)在页面上显示一些html内容。但是什么也没有展示出来。请告诉我哪里错了Extjs 启动应用程序sencha touch时未显示任何内容,extjs,sencha-touch,Extjs,Sencha Touch,我使用Sencha2.3.1和以下代码(在app.js中)在页面上显示一些html内容。但是什么也没有展示出来。请告诉我哪里错了 Ext.application({ name: 'Sencha', requires: ['Ext.tab.Panel'], launch: function() { //The whole app UI lives in this tab panel Ext.Viewport.add({
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("")
}
]
})
}
});
Ext.application({
名称:"Sencha",,
需要:['Ext.tab.Panel'],
启动:函数(){
//整个应用程序UI都位于此选项卡面板中
Ext.Viewport.add({
xtype:'tabpanel',
全屏:对,
tabBarPosition:'底部',
项目:[
//这是主页,只是一些简单的html
{
标题:"家",,
iconCls:“家”,
cls:“家”,
可滚动:对,
html:[
'',
“欢迎来到Sencha Touch”,
“构建入门应用程序”“,
‘Sencha Touch(2.0.0)’
].join(“”)
}
]
})
}
});
在Sencha Fiddle中进行了快速检查,您的内容似乎显示出来了
但是,我看到您将cls属性附加到此选项卡面板,这可能是造成问题的原因
此外,通常情况下,Sencha中不会显示内容,因为组件的高度为零。打开DOM检查器,找到tabpanel和子元素,确保它们的高度大于零。您可能需要定义高度,或使用不同的布局,如“适合” 找到了错误。1.Sencha不在firefox上运行。2.试图在不启动服务器的情况下直接运行indx.html文件。请查看我在本文中的回答-您可以在禁用web安全的情况下作为文件运行。