Sencha touch 2 当侦听器在TabPanel元素上更改时,如何更改标题栏文本?

Sencha touch 2 当侦听器在TabPanel元素上更改时,如何更改标题栏文本?,sencha-touch-2,Sencha Touch 2,我需要改变标题栏文字时,改变或使点击图标的选项卡面板。我创造了 bar.js Ext.define('myapp.view.Myclass', { extend: 'Ext.Titlebar', config: { title: '', } }) Ext.define('myapp.view.Viewport' , { extend: 'Ext.TabPanel', config: { tabBarPosition: 'bottom',

我需要改变标题栏文字时,改变或使点击图标的选项卡面板。我创造了

bar.js

Ext.define('myapp.view.Myclass', {
   extend: 'Ext.Titlebar',

   config: {
      title: '',
   }
})
Ext.define('myapp.view.Viewport' , {
extend: 'Ext.TabPanel',

config: {
      tabBarPosition: 'bottom',
      items: [
         {
            xtype: 'myicon1'
         },
         {
            xtype: 'myicon2'
         },
      ]
    }
})
Ext.define('myapp.view.MyIcon1', {
extend: 'Ext.Panel',
xtype: 'myicon1',

   config: {
     ...
   }
})
Viewport.js

Ext.define('myapp.view.Myclass', {
   extend: 'Ext.Titlebar',

   config: {
      title: '',
   }
})
Ext.define('myapp.view.Viewport' , {
extend: 'Ext.TabPanel',

config: {
      tabBarPosition: 'bottom',
      items: [
         {
            xtype: 'myicon1'
         },
         {
            xtype: 'myicon2'
         },
      ]
    }
})
Ext.define('myapp.view.MyIcon1', {
extend: 'Ext.Panel',
xtype: 'myicon1',

   config: {
     ...
   }
})
MyIcon1.js

Ext.define('myapp.view.Myclass', {
   extend: 'Ext.Titlebar',

   config: {
      title: '',
   }
})
Ext.define('myapp.view.Viewport' , {
extend: 'Ext.TabPanel',

config: {
      tabBarPosition: 'bottom',
      items: [
         {
            xtype: 'myicon1'
         },
         {
            xtype: 'myicon2'
         },
      ]
    }
})
Ext.define('myapp.view.MyIcon1', {
extend: 'Ext.Panel',
xtype: 'myicon1',

   config: {
     ...
   }
})

所以,当我在标题栏上点击图标的动态更改标题时。谢谢,我需要帮助。

只需收听选项卡面板上的
activeitemchange
事件:

activeitemchange: function( container, value, oldValue, eOpts ){
  ...
}
在这个函数中,只需从
value
参数中获取新选项卡的名称,并将标题设置为标题栏


希望这有帮助

谢谢@tdebaileul,对不起,您有联系的电子邮件吗?:)查看我的stackoverflow个人资料页面,然后按照链接到我的投资组合,然后转到联系人页面。