Use the Material Design Snackbar in your {N} app, iOS uses SSSnackbar Cocoapod
npm install nativescript-snackbar
var snackbar = require("nativescript-snackbar");snackbar.simple("I Love NativeScript!").then(function(result) {
console.log(result);
}); // Set the options
var options = {
// The snackText here is the main text to display with the snackbar. (REQUIRED)
snackText: "Emails Deleted.",
// Time in ms before it hides/animates out of view (OPTIONAL).
hideDelay: 3000,
// The actionText will appear on the right side and is interactive if the user taps it before the snackbar hides (REQUIRED, if null defaults to .SIMPLE snackbar)
actionText: "UNDO",
actionTextColor: "#FF4081", // ANDROID ONLY (OPTIONAL), internally checks for android
};
// Open the snackbar
snackbar.action(options)
.then(function(args){
//Returns a promise
if(args.command == "Action"){
//Action
}else {
//Dismissal or timeout
}
});
}); snackbar.dismiss();- Steve McNiven-Scott @stevemcniven
- Nathanael Anderson @CongoCart
