sencha触摸水平滚动和Hbox

时间:2015-04-07 09:24:44

标签: css sencha-touch-2 horizontal-scrolling

您好我无法帮助解决我难以面对的情景。我有一个图像的水平列表视图,我想在屏幕上只显示三个图像,并突出显示中心图像。

我尝试了旋转木马,但只有突出显示的图像才会滚动,我想要横向滚动。

在水平列表视图的顶部使用hbox面板有用吗?

var superpanel = new Ext.Panel({
    fullscreen: true,
    layout: 'hbox',             
    items: [
        {
           xtype: 'panel',
           id: 'panel_1',
           width: '100%',
           layout: 'fit',
           items: [
                {
                   xtype: 'list',
                   flex:1,
                   id: 'list1',
                   store: 'samplestore1'
                }
           ]
         }
    ]
 });

有人可以帮助解决方案如何实现这一目标。 非常感谢任何帮助

1 个答案:

答案 0 :(得分:0)

你不需要旋转木马。 Dataview将达到目的。看看这个家伙:

 Ext.define('Example.view.HorizontalList', {
            extend: 'Ext.dataview.DataView',
            xtype: 'horizontallist',
            config: {
                inline: {
                    wrap: false
                },
                scrollable: {
                    direction: 'horizontal'
                },

                //set the itemtpl to show the fields for the store
                itemTpl: '{name} {image}',

                //bind the store to this list
                store: 'xyz'
            }
        });

您还可以查看this