安卓4.2上彈出消息框 點擊後不消失的解決辦法

原文地址:http://www.itnose.net/detail/6039858.html


[Phonegap+Sencha Touch] 移動開發19 某些安卓手機上彈出消息框 點擊後不消失的解決辦法

2014-05-11 18:01

Ext.Msg.alert等彈出框在某些安卓手機上,點擊確定後不消失。

原因是:

消息框點擊確定後有一段css3 transform動畫,動畫完成後纔會隱藏(display:none)。有些奇葩手機就是不一樣。


解決辦法就是禁用消息框的動畫: 

方法一:

在app.js的launch方法裏面加上

Ext.Msg.defaultAllowedConfig.showAnimation = false
Ext.Msg.defaultAllowedConfig.hideAnimation = false


方法二(這個估計會禁用掉很多地方的動畫效果):

在app.js的launch方法裏面加上

Ext.define('Ext.Component', {
    override: 'Ext.Component',
    show: function (animation) {
        return this.callParent([false]);
    },
    hide: function (animation) {
        return this.callParent([false]);
    }
});

發佈了24 篇原創文章 · 獲贊 9 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章