Sencha touch 2 从sencha touch 2中的容器中引用旋转木马X类型
我有以下代码:Sencha touch 2 从sencha touch 2中的容器中引用旋转木马X类型,sencha-touch-2,Sencha Touch 2,我有以下代码: Ext.define('play.view.Quiz', { extend: 'Ext.Container', xtype: 'myquiz', config: { fullscreen: true, layout: 'vbox', title: 'My Quiz', items: [ /* Questions */ { xtype: 'my_questions' },
Ext.define('play.view.Quiz', {
extend: 'Ext.Container',
xtype: 'myquiz',
config: {
fullscreen: true,
layout: 'vbox',
title: 'My Quiz',
items: [
/* Questions */
{
xtype: 'my_questions'
},
]
}
});
及
问题不会显示,但当我将问题放在测验项目中时,它们会显示出来
是否可以从容器中引用转盘X类型?是@Bohbo您可以这样做:
Ext.define('play.view.Questions', {
extend: 'Ext.Carousel',
xtype: 'my_questions',
config: {
defaults: {
styleHtmlContent: true,
layout: 'fit',
items: [
{
html : 'Item 1',
style: 'background-color: #5E99CC'
},
{
html : 'Item 2',
style: 'background-color: #759E60'
},
{
html : 'Item 3'
}
]
},
});
注意重要的元素是布局:'fit'。我希望这有帮助。:) 仅更改
容器上的布局:'vbox'
的布局:'fit'
主'myquick'。
Ext.define('play.view.Questions', {
extend: 'Ext.Carousel',
xtype: 'my_questions',
config: {
defaults: {
styleHtmlContent: true,
layout: 'fit',
items: [
{
html : 'Item 1',
style: 'background-color: #5E99CC'
},
{
html : 'Item 2',
style: 'background-color: #759E60'
},
{
html : 'Item 3'
}
]
},
});