javascript - Sencha touch 2 native 版本未加载

标签 javascript ios json sencha-touch-2

生成默认应用后:

sencha generate app Sencha ../Sencha

我决定在 iOS 模拟器上测试应用

cd ../Sencha/
sencha app build native

它加载应用程序但卡在加载图标上: Sencha iOS app stuck at loading screen

下面是主应用程序 (App.js) 的代码:

Ext.application({
    name: 'Sencha',

    requires: [
        'Ext.MessageBox'
    ],

    views: ['Main'],

    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'
    },

    isIconPrecomposed: true,

    startupImage: {
        '320x460': 'resources/startup/320x460.jpg',
        '640x920': 'resources/startup/640x920.png',
        '768x1004': 'resources/startup/768x1004.png',
        '748x1024': 'resources/startup/748x1024.png',
        '1536x2008': 'resources/startup/1536x2008.png',
        '1496x2048': 'resources/startup/1496x2048.png'
    },

    launch: function() {
        // Destroy the #appLoadingIndicator element
        Ext.fly('appLoadingIndicator').destroy();

        // Initialize the main view
        Ext.Viewport.add(Ext.create('Sencha.view.Main'));
    },

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

下面是主视图的代码(Main.js):

Ext.define("Sencha.view.Main", {
    extend: 'Ext.tab.Panel',
    requires: [
        'Ext.TitleBar',
        'Ext.Video'
    ],
    config: {
        tabBarPosition: 'bottom',

        items: [
            {
                title: 'Welcome',
                iconCls: 'home',

                styleHtmlContent: true,
                scrollable: true,

                items: {
                    docked: 'top',
                    xtype: 'titlebar',
                    title: 'Welcome to Sencha Touch 2'
                },

                html: [
                    "You've just generated a new Sencha Touch 2 project. What you're looking at right now is the ",
                    "contents of <a target='_blank' href=\"app/view/Main.js\">app/view/Main.js</a> - edit that file ",
                    "and refresh to change what's rendered here."
                ].join("")
            },
            {
                title: 'Get Started',
                iconCls: 'action',

                items: [
                    {
                        docked: 'top',
                        xtype: 'titlebar',
                        title: 'Getting Started'
                    },
                    {
                        xtype: 'video',
                        url: 'http://av.vimeo.com/64284/137/87347327.mp4?token=1330978144_f9b698fea38cd408d52a2393240c896c',
                        posterUrl: 'http://b.vimeocdn.com/ts/261/062/261062119_640.jpg'
                    }
                ]
            }
        ]
    }
});

最佳答案

app.json 中的 "logger": "no" 更改为 "logger": "false"。完成后,它应该如下所示:

"buildOptions": {
    "product": "touch",
    "minVersion": 3,
    "debug": false,
    "logger": "false"
},

然后使用sencha app build native 再次重建。您可以使用 sencha app build production 在浏览器中重现相同的错误,然后将浏览器指向 http://localhost/path/to/myapp/build/production。如果这样做,则必须先清除浏览器缓存才能正常工作(在 chrome 上: Spanner ->工具-开发人员工具->本地存储->主机名->X(用于删除)。

关于javascript - Sencha touch 2 native 版本未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11639730/

相关文章:

javascript - 谷歌翻译下拉菜单 - 设置该语言本身的语言选项标签

Javascript函数可选参数

javascript - 快捷方式(如果在 ng-click 内而没有 else)

ios - 泄漏和如何处理

json - 解码 JSON 以映射/字符串列表

javascript - 当键是用户输入时,我应该如何使用 map 来获取对象的一些值

ios - 具有半透明图层内容的 SCNMaterial 显示为白色

java - Json 转换错误预计为 : after key

xml - JAX RS - JSON 和 XML 循环/循环引用错误

ios - 对 iOS 7 应用程序使用 iOS 6 主题