0

我想要 Sencha Touch 2 中的圆形列表视图。为此,我使用了 ui:round 属性。但它不起作用。现在左边,它是圆形的。但是对于右侧,它不能正常进行。我想要那个圆形边框内的列表。下面是我的代码:

这是我的代码:

Ext.define('MyApp.view.MyTabPanel', {
extend: 'Ext.tab.Panel',

config: {
    layout: {
        animation: 'fade',
        type: 'card'
    },
    items: [
        {
            xtype: 'container',
            draggable: true,
            styleHtmlContent: true,
            title: 'Artist',
            items: [
                {
                    xtype: 'list',
                    height: 696,
                    ui: 'round',
                    width: 325,
                    modal: true,
                    itemTpl: [
                        '{firstName}'
                    ],
                    store: 'name',
                    onItemDisclosure: true
                }
            ]
        },
        {
            xtype: 'container',
            styleHtmlContent: true,
            scrollable: true,
            title: 'Albums',
            items: [
                {
                    xtype: 'list',
                    height: 730,
                    ui: 'round',
                    width: 325,
                    modal: true,
                    itemTpl: [
                        '{albumlist}'
                    ],
                    store: 'albumstore',
                    onItemDisclosure: true
                }
            ]
        },
        {
            xtype: 'container',
            styleHtmlContent: true,
            title: 'Playlist',
            items: [
                {
                    xtype: 'list',
                    height: 700,
                    ui: 'round',
                    width: 325,
                    modal: true,
                    itemTpl: [
                        '{playlist}'
                    ],
                    store: 'playliststore',
                    onItemDisclosure: true
                }
            ]
        }
    ],
    tabBar: {
        docked: 'top',
        layout: {
            align: 'center',
            pack: 'center',
            type: 'hbox'
        }
    }
}

});

现在它出现在圆形列表中。但是滚动不正常。它不会直到列表的末尾。

4

1 回答 1

1

您在组件中包含了一些冗余配置。

我只对MyTabPanel.js进行了更改(很多)。

这是编辑后的源代码,它适用于Artist List,它也适用于其他组件:

Ext.define('MyApp.view.MyTabPanel', {
    extend: 'Ext.tab.Panel',

    config: {
        layout: {
            animation: 'fade',
            type: 'card'
        },
        items: [
            {
                xtype: 'container',
                layout: 'card',
                //draggable: true,
                styleHtmlContent: true,
                title: 'Artist',
                items: [
                    {
                        xtype: 'list',
                        //height: 696,
                        ui: 'round',
                        //width: 325,
                        //modal: true,
                        itemTpl: [
                            '{firstName}'
                        ],
                        store: 'name',
                        onItemDisclosure: true
                    }
                ]
            },
            {
                xtype: 'container',
                layout: 'card',
                styleHtmlContent: true,
                //scrollable: true,
                title: 'Albums',
                items: [
                    {
                        xtype: 'list',
                        height: 730,
                        ui: 'round',
                        width: 325,
                        modal: true,
                        itemTpl: [
                            '{albumlist}'
                        ],
                        store: 'albumstore',
                        onItemDisclosure: true
                    }
                ]
            },
            {
                xtype: 'container',
                layout: 'card',
                styleHtmlContent: true,
                title: 'Playlist',
                items: [
                    {
                        xtype: 'list',
                        //height: 700,
                        ui: 'round',
                        //width: 325,
                        //modal: true,
                        itemTpl: [
                            '{playlist}'
                        ],
                        store: 'playliststore',
                        onItemDisclosure: true
                    }
                ]
            }
        ],
        tabBar: {
            docked: 'top',
            layout: {
                align: 'center',
                pack: 'center',
                type: 'hbox'
            }
        }
    }

});
于 2012-06-01T10:27:18.127 回答