在Viewport中创建面板

时间:2013-01-04 05:23:02

标签: sencha-touch-2 viewport

我在app.js文件中创建了一个视口。我需要在此视口中创建一个面板。关于如何做到的任何想法?

//<debug>
Ext.Loader.setConfig({disableCaching:false});
Ext.Loader.setPath({
    'Ext': 'sdk/src'
});
//</debug>

Ext.application({
    name: 'SEPA',
    controllers: ["MainController"],
    requires: [
        'Ext.MessageBox'
    ],

    controllers:['MainController'],

    icon: {
        57: 'resources/icons/Icon.png',
        72: 'resources/icons/Icon~ipad.png',
        114: 'resources/icons/Icon@2x.png',
        144: 'resources/icons/Icon~ipad@2x.png'
    },

    phoneStartupScreen: 'resources/loading/Homescreen.jpg',
    tabletStartupScreen: 'resources/loading/Homescreen~ipad.jpg',
    fullscreen: false,
    //centered:true,
    // margin: 100,

    launch: function() {
        Ext.Viewport.setWidth(320);
        Ext.Viewport.setHeight(480);

        //Ext.Viewport.setCentered(false);
        // Ext.Viewport.setRight(2);

        // Destroy the #appLoadingIndicator element

    },

    onUpdated: function() {
        Ext.Msg.confirm(
            "Application Update",
            "This application has just successfully been updated to the latest version. Reload now?",
            function() {
                window.location.reload();
            }
        );
    }
});

1 个答案:

答案 0 :(得分:3)

launch功能

中添加此功能
 var panel = Ext.create('Ext.Panel', {
       // fullscreen: true,
        html: 'Hello from your first Sencha Touch App made by Sencha Fiddle.'
    });

Ext.Viewport.add(panel);

Working example