0
我正在创建一个sencha触摸应用程序,并且设计需要在选项卡栏中有一个分段按钮。如何将一个分段按钮集成到一个tabbar?
是否有一个简单的方法来做到这一点与sencha内置功能,或者我必须自己创建(添加一个带有分段按钮的工具栏作为一个项目,并创建所有控件,以实际获得相同的东西) ?
extend: 'Ext.TabPanel',
requires: [
'Ext.SegmentedButton',
],
xtype: 'album',
id: 'album',
fullscreen: true,
config: {
tabBar: {
layout: {
pack: 'center',
},
items: {
xtype: 'segmentedbutton',
allowDepress: false,
listeners: {
initialize: function() {
Ext.SegmentedButton.implement({
setActive: function(activeItem) {
this.setActiveItem(activeItem);
}
});
}
}
}
},
autoDestroy: true,
activeItem: 1,
items: [
{
title: 'HIGHLIGHTS',
xtype: 'highlightview',
id: 'highlightView'
},
{
title: 'KATEGORIEN',
xtype: 'categoryView',
id: 'categoryView',
},
{
title: 'SUCHE',
xtype: 'searchView',
id: 'searchView',
}
],
}
这就是我到目前为止的尝试。听众在那里解决[Object] Object has no method 'setActive'
的错误,但不会导致我想要的行为。
你将需要添加一个分段按钮,标签栏的项目。 – blessenm
然后框架抱怨,没有方法setActive。对于分段按钮,这种方法被称为setActiveItem – wiseveri
把你的代码加起来。其他人可能会理解什么是错误的。 – blessenm