Titanium - Label animation
var view;
var text;
var footerViewDisp = function() {
view = Ti.UI.createView({
backgroundColor: '#A680b82b',
height: 40
});
text = Ti.UI.createLabel({
text: "Cargando...",
left: 20,
color: '#618233',
font: {
fontFamily:'HelveticaNeue-Light',
fontSize: 15
}
});
view.add(text);
view.addEventListener('click', function (e){
myLoaderDisp();
});
return view;
};
function myLoaderDisp(){
Ti.API.debug("myLoaderDisp");
var matrix = Ti.UI.create2DMatrix();
//matrix = matrix.rotate(180);
matrix = matrix.scale(0.9, 0.9);
var a = Ti.UI.createAnimation({
transform : matrix,
duration : 800,
autoreverse : true,
repeat : 2
});
text.animate(a);
a.addEventListener("complete",function(e){
//text.color = "red";
});
}
var tableView = Ti.UI.createTableView({
backgroundColor:'white',
data:tableData,
footerView: footerViewDisp()
});
$.index.add(tableView);
var text;
var footerViewDisp = function() {
view = Ti.UI.createView({
backgroundColor: '#A680b82b',
height: 40
});
text = Ti.UI.createLabel({
text: "Cargando...",
left: 20,
color: '#618233',
font: {
fontFamily:'HelveticaNeue-Light',
fontSize: 15
}
});
view.add(text);
view.addEventListener('click', function (e){
myLoaderDisp();
});
return view;
};
function myLoaderDisp(){
Ti.API.debug("myLoaderDisp");
var matrix = Ti.UI.create2DMatrix();
//matrix = matrix.rotate(180);
matrix = matrix.scale(0.9, 0.9);
var a = Ti.UI.createAnimation({
transform : matrix,
duration : 800,
autoreverse : true,
repeat : 2
});
text.animate(a);
a.addEventListener("complete",function(e){
//text.color = "red";
});
}
var tableView = Ti.UI.createTableView({
backgroundColor:'white',
data:tableData,
footerView: footerViewDisp()
});
$.index.add(tableView);
Comentarios
Publicar un comentario