[英]Sencha Touch 2 - Add Carousel to Panel
我正在尝试将旋转木马添加到“面板”视图中,该视图内部具有多个子面板。 当我运行代码时,虽然看不到轮播中的任何内容。 其他面板看起来很好。 这是我现在得到的代码
Ext.define('app.view.HeroDetail', {
extend: 'Ext.Panel',
requires: ['Ext.Carousel'],
xtype: 'herodetail',
layout: 'vbox',
fullscreen: true,
config: {
items: [
{
xtype: 'panel',
html: 'first panel',
flex: 1
},
{
xtype: 'carousel',
items: [
{
xtype: 'panel',
html: 'carousel1'
},
{
xtype: 'panel',
html: 'carousel2'
}
],
flex: 1
},
{
xtype: 'panel',
html: 'second panel',
flex: 1
}
]
}
});
我在这里想念什么?
试试这个代码。 这对我有用。 在配置中定义布局:“ vbox” 。
Ext.define('app.view.HeroDetail', {
extend: 'Ext.Panel',
requires: ['Ext.Carousel'],
xtype: 'camerapanel',
fullscreen: true,
config: {
layout: 'vbox', //defines layout inside config
items: [
{
xtype: 'panel',
html: 'first panel',
flex: 1
},
{
xtype: 'carousel',
flex: 1,
items: [
{
xtype: 'panel',
html: 'carousel1'
},
{
xtype: 'panel',
html: 'carousel2'
}
]
},
{
xtype: 'panel',
html: 'second panel',
flex: 1
}
]
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.