1. 添加插件:cordova plugin add cordova-plugin-x-toast
2. 調用方法(浮動提示插件,彈出本地浮動提示框):
$cordovaToast.show(message, duration, position).then(
function(success) { if (typeof callback === 'function') { callback(); } },
function (error) { // error }
); /** * 顯示原生的toast * message 要顯示的消息 * duration 顯示時長 long short(2s左右) * position 顯示位置 'top', 'center', 'bottom' * callback 顯示成功的回調函數 */