Use the Android Snackbar in Appcelerator Titanium.
- Copy the
ti.snackbar
folder to yourlib/
(Alloy) or your Resources (Classic) directory - Copy the
design-23.1.1.aar
toapp/platform/android/
(Alloy) orplatform/android
(Classic) - Copy the example code to your Titanium app
- Go for it!
var Snackbar = require('ti.snackbar');
var window = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var btn = Ti.UI.createButton({
title: 'Show message!'
});
btn.addEventListener('click', function() {
Snackbar.show({
message: 'Titanium rocks!',
container: window,
length: Snackbar.SNACKBAR_LENGTH_SHORT,
action: 'Press me!',
onActionClicked: function() {
alert('Action clicked!');
}
});
});
window.add(btn);
window.open();
MIT
© 2017 by Appcelerator