安装
cordova plugin add https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git
使用方法
module.controller('MyCtrl', function($cordovaToast) {
$cordovaToast
.show('Here is a message', 'long', 'center')
.then(function(success) {
// success
}, function (error) {
// error
});
$cordovaToast.showShortTop('Here is a message').then(function(success) {
// success
}, function (error) {
// error
});
$cordovaToast.showLongBottom('Here is a message').then(function(success) {
// success
}, function (error) {
// error
});
});
API
showShortTop(message)
showShortCenter(message)
showShortBottom(message)
showLongTop(message)
showLongCenter(message)
showLongBottom(message)