我使用的是sencha touch carousel,其中我使用的是水平滑动。它工作得很完美。但在这里面,我使用的是我想要垂直滚动的面板(将每一页滚动到底部)。如何做到这一点?我在每个面板中给出了滚动:‘垂直’,如下所示:
var myFirstPage = Ext.Panel({
id:'tableId',
iconCls:'myToolBar',
style:'overflow:auto;' ,
scroll:'vertical',
items:.........});
Ext.setup( {
onReady: function() {
myCarouselId = new Ext.Carousel({
fullscreen: true,
id:'myCar',
items : [ myFirstPage]...............});但我不能将面板滚动到底部。哪里出了问题?
Sencha touch vertical scroll content in a horizontal carousel。根据这个堆栈溢出的答案,我们可以在水平旋转木马中垂直滚动子内容,和我一样。但我在这里做了同样的事情,我不能滚动。我的子面板包含vbox和hbox布局。
有人能回答我的问题吗?
发布于 2013-06-17 14:16:34
试试这个,它对我很有效,我是从sench forum买的
在面板中设置的可滚动配置
scrollable : {
direction : 'vertical',
directionLock : true
}示例
var myFirstPage = Ext.Panel({
id:'tableId',
iconCls:'myToolBar',
scrollable : {
direction : 'vertical',
directionLock : true
},
items:.........});
Ext.setup( {
onReady: function() {
myCarouselId = new Ext.Carousel({
fullscreen: true,
id:'myCar',
items : [ myFirstPage]...............});查看此fiddle
发布于 2013-06-17 14:04:08
编辑:如果你想在你的面板中使用'hbox‘,你需要在容器中适应它的宽度。
如果它需要创建自己的滚动条,它将无法这样做。
您需要的是以不同的方式定义滚动:
scrollable: {
direction: 'vertical',
directionLock : true
}如下所示:
var carousel = Ext.create('Ext.Carousel', {
fullscreen: true,
items : [
{ xtype: 'panel',
scrollable: {
direction: 'vertical',
directionLock: true
},
html: 'This panel is scrollable!',
items: [{
xtype: 'textfield',
name : 'first',
label: 'First'
},
{
xtype: 'textfield',
name : 'second',
label: 'Second'
},{
xtype: 'textfield',
name : 'third',
label: 'Third'
},{
xtype: 'textfield',
name : 'first1',
label: 'First1'
},
{
xtype: 'textfield',
name : 'second1',
label: 'Second1'
},{
xtype: 'textfield',
name : 'third1',
label: 'Third1'
},{
xtype: 'textfield',
name : 'first12',
label: 'First12'
},
{ xtype: 'panel',
layout: 'hbox',
width: 200,
items: [{
xtype: 'textfield',
name : 'first-box',
label: 'First-box'
},
{
xtype: 'textfield',
name : 'second-box',
label: 'Second-box'
},{
xtype: 'textfield',
name : 'third-box',
label: 'Third-box'
}]
}, {
xtype: 'textfield',
name : 'second12',
label: 'Second12'
},{
xtype: 'textfield',
name : 'third12',
label: 'Third12'
}]
}, {
xtype: 'panel',
scroll:'vertical', // will not work
html: 'This panel is not scrollable!',
}]
});您可以在sencha docs的任何实时预览中尝试此功能
希望这能有所帮助
https://stackoverflow.com/questions/17062986
复制相似问题