Sencha在android 2.3上触摸2.4 appLoadingIndicator堆栈

0 android extjs release touch

我刚刚下载了sencha touch 2.4并创建了一个测试Android应用程序.我可以在android 4+上编译和运行应用程序而不会出现问题.但是,当我尝试在Android 2.3上运行它时,应用程序没有通过应用程序加载器指示器并且我记录了该过程没有显示错误.以下是代码:

Ext.application({
name: 'Voice',

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('Voice.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();
            }
        }
    );
}
Run Code Online (Sandbox Code Playgroud)

});

和主要代码:

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

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

            scrollable: true,

            items: [{
                docked: 'top',
                xtype: 'titlebar',
                title: 'Welcome to Sencha Touch 2'
            }]
        },
        {
            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'
                }
            ]
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

});

我认为它必定是2.4 sencha触摸版本中的一个错误

小智 6

我们也遇到了同样的问题,似乎是Sencha Touch 2.4中引入的一个错误.原因是使用bind()方法,它是android 2.3上不支持的ECMAScript 5的一部分

所以要修复它你可以找到文件touch\src\event\publisher\TouchGesture.js并替换以下行

if (Ext.feature.has.Touch) {
    // bind handlers that are only invoked when the browser has touchevents
    me.onTargetTouchMove = me.onTargetTouchMove.bind(me);
    me.onTargetTouchEnd = me.onTargetTouchEnd.bind(me);
}
Run Code Online (Sandbox Code Playgroud)

用这些

if (Ext.feature.has.Touch) {
    // bind handlers that are only invoked when the browser has touchevents
    me.onTargetTouchMove = Ext.Function.bind(me.onTargetTouchMove, me);
    me.onTargetTouchEnd = Ext.Function.bind(me.onTargetTouchEnd, me);
}
Run Code Online (Sandbox Code Playgroud)

这个解决方案帮助我们避免了这个问题