0

我想使用 sencha 创建一个面板。我尝试了以下代码。但它不起作用。

Ext.setup({
    icon: 'icon.png',
    tabletStartupScreen: 'tablet_startup.png',
    phoneStartupScreen: 'phone_startup.png',
    glossOnIcon: false,
    onReady: function () {
        var main = new Ext.Panel({
            title: 'My first panel', //panel's title
            width: 250, //panel's width
            height: 300, //panel's height
            //the element where the panel is going to be inserted
            html: 'Nothing important just dummy text' //panel's content
        });
        main.render('frame');
    }
});
4

2 回答 2

0

我认为您缺少面板的布局,如果您将“全屏”属性设置为 true,那么您应该会看到您的面板显示出来。

面板上有一个很好的视频教程http://vimeo.com/15879797

希望对您有所帮助,我现在也在学习煎茶!

Ext.setup({
          icon: 'icon.png',
          tabletStartupScreen: 'tablet_startup.png',
          phoneStartupScreen: 'phone_startup.png',
          glossOnIcon: false,
          onReady: function() {


          var main = new Ext.Panel({  
                                   title: 'My first panel', //panel's title  
                                   fullscreen: true,
                                   //the element where the panel is going to be inserted 
                                   html: 'Nothing important just dummy text' //panel's content  
                                   });  

          }
          });
于 2010-10-22T08:59:07.870 回答
0

如果您在使用 Sencha Touch 时仍然遇到问题,请访问以下网站:http: //miamicoder.com/2011/writing-a-sencha-touch-application-part-1/

我自己用它来学习开发 Sencha Touch 应用程序的基础知识。writher 很好地解释了代码,并展示了如何编写一些基本的东西,如本地存储、导航和列表。

于 2011-12-20T11:15:35.860 回答