我是 Sencha Touch 的新手,只是想在 TabPanel 中放置一个工具栏。我这样做是因为 TabPanel 将是我的主要导航,而 Toolbar 将提供一些与内容相关的操作,例如创建新作业或类似的东西。
这是我的“解决方案”,它根本不起作用。TabPanel 出现了,“Hello World”也出现了,但不会有任何工具栏。
var tapHandler = function(btn, evt) {
alert("Button "+btn.text+" tapped");
}
var HomeScreen = new Ext.Panel({
fullscreen: true,
dockedItems: [
{
xtype: "toolbar",
title: "buttons",
ui: "light",
dock: "bottom",
items: [
{ui: "action", text: "Add"}
],
defaults: {
handler: tapHandler
}
}
],
html: "Hello World"
});
new Ext.Application({
name: "Hello World",
launch: function() {
var tabPanel = new Ext.TabPanel({
fullscreen: true,
ui: 'dark',
sortable: true,
items: [
{
title: "Home",
html: "Loading..."
}
]
});
tabPanel.items.get(0).update(HomeScreen, true);
}
});
你有什么解决办法?
问候,马丁