简体   繁体   English

Sencha触摸轮播不可见

[英]Sencha Touch Carousel Not Visible

I'm attempting to render a simple carousel in Sencha Touch, however, it's not showing up. 我正在尝试在Sencha Touch中渲染一个简单的轮播,但是它没有出现。 The only thing I see are the indicator dots for the items. 我唯一看到的是项目的指示点。 Inspecting in Chrome shows that the tags are being added, but I can't see them. 在Chrome浏览器中检查表明已添加了标签,但看不到它们。

Carousel View: 轮播视图:

Ext.define('Project.view.ChartCarousel', {
    extend : 'Ext.Carousel',
    xtype : 'chartCarousel',
    config : {
        title : 'Title',
        fullscreen: 'true',
        width: '100',
        height: '100',
        jumpToIndex: 0,
        defaults : {
            padding: '10 10 10 10'
        },
        items : [{
            html:'<div style="text-align:center">test 1</div>'
        }, {
            html:'<div style="text-align:center">test 2</div>'
        }, {
            html:'<div style="text-align:center">test 3</div>'
        }]
    }
});

Containing View: 包含视图:

Ext.define('Project.view.SummaryChart',{
        extend: 'Ext.form.Panel',
    xtype: 'summaryChart',
    requires: [
            'Ext.Toolbar'
    ],
    config: {
        items: [

            {
                xtype: 'chartCarousel'
            }

        ]
    },
    initialize: function() {
        this.callParent(arguments);
    }
});

I found the answer. 我找到了答案。 I needed to add flex: '1' to the carousel's config. 我需要在轮播的配置中添加flex: '1'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM