我正在使用sencha touch2。我有一个选项卡面板,我在其中放置了许多选项卡。我想始终显示水平滚动条,以便用户知道还有更多选项卡。这是我的标签面板,带有TABBAR配置。如何使滚动条指示器始终可见?:
Ext.define('Project.view.Result', {
extend: 'Ext.tab.Panel',
id:'searchTab',
tabBar: {
scrollable:'horizontal',
scrollBar:'true',
docked:'top',
layout: {
pack: 'center',
},
},
items:[
{
title: 'A Result',
xtype:'AList'
},
{
title: 'B Result',
xtype:'BList'
},
......
......
{
title: 'Z Result',
xtype:'ZList'
}
]
});
我尝试了CSS:
#searchTab .x-scroll-indicator[style] {
opacity: 0.5 !important;
}
,但是随后每个选项卡下的列表项都可以看到滚动条。但不是为tab栏。
您几乎得到了它,只需将您的CSS更改为
.x-tabpanel .x-scroll-indicator {
opacity: 0.5 !important;
}
希望它有帮助:)
"新的触摸2.3.0,每个指示器都有一个自动螺旋配置 允许您控制它。将Autohide设置为false会说明 指示器不自动隐藏。您可以在内部使用指标配置 容器或子类上的可滚动配置。"
http://www.sencha.com/blog/top-support-tips-march-2014
Ext.application({
name: 'Fiddle',
launch : function() {
Ext.Viewport.add({
xtype: 'container',
html: 'The y scroll indicator will always show, x will hide as autoHide defaults to true',
scrollable: {
direction: 'both',
indicators: {
y: {
autoHide: false
}
}
}
});
}
});
https://fiddle.sencha.com/#fiddle/1u9