煎茶触摸2.4 appLoadingIndicator堆栈上的Andr​​oid 2.3堆栈、appLoadingIndicator、oid、Andr

2023-09-07 01:16:17 作者:执手梦偕老

我刚才下载煎茶触摸2.4并创建了一个测试Android应用程序。我能够编译和运行在Android 4+的应用程序没有问题。然而,当我尝试在Android 2.3的运行,应用程序不走过去的应用程序加载器指示灯和我的记录显示没有错误的过程。以下是code:

I have just downloaded sencha touch 2.4 and created a test android app. I am able to compile and run the app on android 4+ without problems. However, when I try to run it on android 2.3, the app doesn't go past the app loader indicator and I logged the process no errors are being displayed. Following is the code:

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();
            }
        }
    );
}

});

和主要code:

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: 'https://m.xsw88.com/allimgs/daicuo/20230907/4051.png.jpg'
                }
            ]
        }
    ]
}

});

我想那一定是在2.4煎茶触摸释放错误

I think it must be a bug in the 2.4 sencha touch release

推荐答案

我们也有同样的问题,这似乎是在煎茶触摸2.4引入了一个错误。其原因就在于bind()方法的使用是不支持的Andr​​oid 2.3的ECMAScript 5的一部分

We also had the same issue and it seems that it is a bug introduced in Sencha Touch 2.4. And the reason is the usage of bind() method which is a part of ECMAScript 5 not supported on android 2.3

因此​​,要解决它,你可以找到文件touch的\\ src \\事件\\出版商\\ TouchGesture.js并替换以下行

So to fix it you can find the file touch\src\event\publisher\TouchGesture.js and replace the following lines

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);
}

这些

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);
}

该解决方案帮助我们避免这些问题。

This solution helped us to avoid the problem