2
我想知道如何在導航視圖中瀏覽後退按鈕。我嘗試使用onBackButtonTap但它似乎沒有工作http://www.senchafiddle.com/#8zaXfSencha Touch 2:如何覆蓋導航視圖上的返回按鈕
var view = Ext.Viewport.add({
xtype: 'navigationview',
onBackButtonTap: function() {
alert('Back Button Pressed');
},
//we only give it one item by default, which will be the only item in the 'stack' when it loads
items: [
{
//items can have titles
title: 'Navigation View',
padding: 10,
//inside this first item we are going to add a button
items: [
{
xtype: 'button',
text: 'Push another view!',
handler: function() {
//when someone taps this button, it will push another view into stack
view.push({
//this one also has a title
title: 'Second View',
padding: 10,
//once again, this view has one button
items: [
{
xtype: 'button',
text: 'Pop this view!',
handler: function() {
//and when you press this button, it will pop the current view (this) out of the stack
view.pop();
}
}
]
});
你的小提琴不能在瀏覽器(Chrome)中運行。拋出語法錯誤。 – MCL 2013-02-13 18:27:26
在這行'padding:10'後面缺少'',''。 – SachinGutte 2013-02-13 18:34:30
@phazor您是對的 – ninjasense 2013-02-13 18:52:57