Sencha触摸表单面板没有显示

时间:2012-11-23 22:22:42

标签: sencha-touch sencha-touch-2 sencha-architect

由于某种原因,我的表单面板没有显示。有人可以帮忙吗?我很新手很抱歉,如果这很明显!它是使用Sencha Architect构建的,但我无法理解为什么表单中没有字段显示?...

Ext.define('MyApp.view.Login', {
    extend: 'Ext.Container',

    config: {
        layout: {
            type: 'vbox'
        },
        items: [
            {
                xtype: 'titlebar',
                docked: 'top',
                title: 'My Title'
            },
            {
                xtype: 'toolbar',
                docked: 'top',
                items: [

                    {
                        xtype: 'button',
                        text: 'Call'
                    },
                    {
                        xtype: 'button',
                        text: 'Email'
                    }                       
                ]
            },
            {
                xtype: 'container',
                flex: 1,
                border: 2,
                items: [
                    {
                        xtype: 'formpanel',
                        styleHtmlContent: true,
                        items: [
                            {
                                xtype: 'fieldset',
                                title: 'MyFieldSet',
                                items: [
                                    {
                                        xtype: 'textfield',
                                        label: 'Field'
                                    },
                                    {
                                        xtype: 'textfield',
                                        label: 'Field'
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }

});

2 个答案:

答案 0 :(得分:3)

要在其他容器内正确使用Sencha Touch 2.3+显示formpanel(Ext.form.Panel),您需要添加scrollable: null属性

{
    xtype: 'formpanel',
    scrollable: null,         
    items: [
        ...
    ]
}

参见讨论here

答案 1 :(得分:2)

将您的登录视图的layoutvbox更改为fit。然后将包含formpanel的容器的layout也设置为fit

检查this link以获取有关Sencha Touch中布局的更多信息。

相关问题