Sencha Touch中的2个滚动列表不滚动 [英] 2 scrolling lists in Sencha Touch don't scroll

查看:90
本文介绍了Sencha Touch中的2个滚动列表不滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Sencha Touch中有2个列表项,它们已添加到我的面板中.每个列表的宽度为50%,高度为全屏.面板全屏显示高度.每个列表都有一个包含约100个项目的商店.

I have 2 List items in Sencha Touch, that have been added to my panel. Each list has width=50% and height=fullscreen. The panel has height full screen. Each list has a Store containing about 100 items.

Sencha错误估计了列表的范围,并且不允许我向下滚动.我只能放下几件物品,然后它会突然回弹.

Sencha mis-estimates the extent of the list and does not allow me to scroll down. I can only go down a couple of items and it snaps back.

我如何并排滚动列表项?

How do I get side by side list items to scroll?

谢谢, 格里

推荐答案

这对我有用,我认为诀窍是每个面板的Layout值.

This works for me I think the trick is the Layout value for each Panel.

"hbox"代表父级,然后适合"于两个半面板,如果并排"面板未设置为适合列表,则无法正确滚动.

'hbox' for parent, then 'fit' for the two half panels, if the "side by side" panels aren't set to fit a list won't scroll properly.

root = new Ext.Panel({
    fullscreen: true,
    layout: 'hbox',
    version: '1.1.1',
    scroll: false,
    items: [{
        xtype: 'panel',
        width: '50%',
        height: '100%',
        layout: 'fit',
        items: [{
            xtype: 'list',
            itemTpl: '{display}',
            store: new Ext.data.Store({
                model: 'item',
                data: [...]
            })
         }]
    }, {
        xtype: 'panel',
        width: '50%',
        height: '100%',
        layout: 'fit',
        items: [{
            xtype: 'list',
            itemTpl: '{display}',
            store: new Ext.data.Store({
                model: 'item',
                data: [...]
            })
         }]
     }]
 });

这篇关于Sencha Touch中的2个滚动列表不滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆